hmm... I don't understand what you mean. Does your function work in such a manner that you can add and substract as much life as you want (practically, modifying it to any value)? It is more than possible to make such a function if you haven't got it. Anyway... the problem is just like reducing a unit's current with 20%. Let's THINK it:
Unit has an amount of 'LX' life (variable amount). If we want to reduce 20%, it would look like this:
FX (final life after reduction) = LX-(LX*20/100)=LX-(LX*0.20)=LX*0.80
For a percentage PG, the formula looks like this:
FX=LX*(1-PG/100)
Now, let's get back to another problem. Let's say that you want to boost the unit's life back to the original LX. Hmm, we know that the reduction was 20%. We had this:
FX=LX(1-PG/100) => LX=FX/(1-PG/100)
Replacing with the percentage, we get this:
LX=FX/(1-0.20)=FX/(4/5)=FX*(5/4)=FX*1.25
Hope this whole stuff made sense. Good luck implementing it!
-Mihai