ignoring the bar, you need to set a current max energy for the player. lets called this 'energyMax'.
When you say character with 5 energy, you mean he has 5 energy to start so that is 'energyMax'.
the current energy is 'energy', and you set this to 'energyMax' at the start of the game and I imagine you decrease 'energy' by using it.
so you start with 5/5 energy.
we now calculate a percentage regardless of starting energy, whether its 5 you are slotting in or 1000.
fill = energy/energymax* 100 = 5/5*100. what you have now is a percentage of fill for the bar.
so if your guy now dropped to 3 energy. the fill of the bar would be energy/energymax*100 = 3/5*100 = 60%
To answer your question, using the fill bar formula, the energy that the player starts with which is what I think you are trying to slot in is energyMax.
This also auto-resolves the bar decrease speed because it is always a percentage. if you have 5 energy it will drop 20% of the bar a time, whereas if you have 1000 energy to start with and decrease by 1 you will see almost no change because it is going to 999, 998 etc which is a small percentage of the bar.
The next step is how you want to apply that percentage outcome (fill var) to the bar width. You can just say object.width = fill which means its width would be between 0-100 just to test it out, then multiply this later if you need it larger. You could also use the built in object progress bar to test it out and set progress=fill.
To summarise after you've read that and understood what I mean with the values, you just need 3 variables and a formula :
energy - the current energy,
energymax - the max energy allowed or total given at the start,
fill - a variable to store the percentage,
set var fill = energy/energymax*100