HP and MP stay the same percent (%) when leveling up.

So what I'd like to have is a script that heals you for the percentage of the health you have at the moment when you level up.
For example if my max HP is 1000 and I level up to 1200 HP my HP will stay at 1000 normally, but with this script it would heal to 1200. And if I had 500 HP aka 50% of HP during level up, my current HP would rise to 600 which is 50% of 1200 obviously.

I have this small script made by Yato:

Code:
class Game_Actor < Game_Battler
  alias heal_on_level_up level_up
  #--------------------------------------------------------------------------
  # * Level Up
  #--------------------------------------------------------------------------
  def level_up
    heal_on_level_up
    @hp = mhp
    @mp = mmp
  end
end

And I was wondering if something could be done to the mhp and mmp parts since those heal you fully.

This is for VX Ace btw forgot to add that.

I've moved this thread to RGSSx Script Support. Thank you.

Relative Basic Stats - it sounds like this is exactly what you're after?
Ideally:

Code:
class Game_Actor < Game_Battler
  alias heal_on_level_up level_up
  #--------------------------------------------------------------------------
  # * Level Up
  #--------------------------------------------------------------------------
  def level_up
    prevhp = hp_rate
    prevmp = mp_rate
    heal_on_level_up #old leveling method
    @hp = mhp * prevhp
    @mp = mmp * prevmp
  end
end

What's happening here is that I first record the rates of the previous HP/MP (ex: 50/100 = 0.5). Next comes the alias which executes the original level_up method. After that, I change the current hp/mp by multiplying the rates we originally got with what should be the current max hp/mp (ex 0.5 * 150 = 75).
Thanks guys, both of these are great!

Original thread: https://forums.rpgmakerweb.com/threads/hp-and-mp-stay-the-same-percent-when-leveling-up.84917/