How to make a transform skill where the character heals a percentage of their current HP

I have a character who can transform into a bear mid battle. I've set this as a state and her max HP goes up by 160%.

I want to make it so that when she transforms, the percentage difference of her normal form's hp correlates to the new hp, if you get what I mean.

For example, say in normal form her max hp is 100 and she has been damaged so that her current hp now sits at 75. There is now a 25% difference between her current hp and her max hp. When she transforms into a bear her max hp will rise to 160. Currently all I can do is have her current hp stay at 75 or it all heals up to 160, but what I really want it to do is to increase up to 120 so that there is still only a 25% difference between max hp and current hp.

I tried having a common event where it sets a variable for her current hp and multiply that by 1.6 then to heal hp amount set to that variable, but it didn't accept decimals and it made her heal fully anyway.
The common event is still the only way to go, but you need to work on the formula because all decimals are cut off when converting into integer variables.


Instead of multiplying by 1.6, you multiply by 160 and then divide by 100 - it's important that the multiplication is first and the division last to minimize the effect of the integer-cutoff.
That makes sense, but it's still not working.

I think my problem is it's healing her the amount of hp that it sets it to be, and not bringing her up to to that amount. 

Here is the event process:

If state bear is inflicted

-set variable hp to players hp

-control variable hp * 160

-control variable hp / 100

-change hp, player + variable hp
I think my problem is it's healing her the amount of hp that it sets it to be, and not bringing her up to to that amount.
That is correct, in change HP you always need to give the wanted difference.
Just add one more control variable, substracting the current player HP, before using change HP.
Thanks! It works! Now just one more thing... how can I reverse the effect when I transform back to regular form?
back to the exact HP before: store the value in a variable before changing


back to a proportional part of the remaining HP: reverse the formula (multiply by 100, divide by 160)

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-transform-skill-where-the-character-heals-a-percentage-of-their-current-hp.22249/