Energy Dashbord cost calculate

Is it possible to configure the energy card to calculate costs differently?

I have an energy cost entity added, but now the cost is calculated as follows:

cost = (consumed energy - energy given away) * energy price

and due to a different way of billing energy (I am a prosumer in PL), the cost is calculated as follows:

cost = (consumed energy - (0.8 * energy given away)) * energy price

there is a way to edit it somehow? or somehow extract the cost data from this card and create your own sensor?