Template energy meter

hi everyone,
I have a problem regarding energy tariffs, regulations in my country stipulate fixed kwh rates and tariffs based on installed power, and both are calculated based on kwh usage.

formula:
Minimum Account + usage fee (Rp * kWh) = total usage fee (Rp)

Minimum Account Formula:
40(Active Hours) x Connected Power(VA) x price (Rp/kWh)

Usage Fee Formula:
price(Rp/kWh) x total kWh (kWh)

can I ask for help to make the template?
I don’t understand about scripting, that’s why I’m asking for help here.