this wont work for xp theres no def levelup in xp. ive quickely knocked this up using the ideals of the one you linked this should work in xp although it may be uncompatible with another script if it also messes with the exp method:
#===============================================================================
# Recover Hp/Sp/State on levelup
#-------------------------------------------------------------------------------
# Version 1.0
#-------------------------------------------------------------------------------
# By ahref. Based on the ideas of the vx version by worale
#===============================================================================
class Game_Actor < Game_Battler
#You can change these values!!!
RECOVER_HP = true # recover hp when you level up true/false
RECOVER_SP = true # recover sp when you level up true/false
RECOVER_STATE = true #recover state when you level up
#--------------------------------------------------------------------------
# * Change EXP
# exp : new EXP
#--------------------------------------------------------------------------
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
# Level up
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
@hp = self.maxhp if RECOVER_HP
@sp = self.maxsp if RECOVER_SP
@states.clear if RECOVER_STATE
# Learn skill
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
# Level down
while @exp < @exp_list[@level]
@level -= 1
end
# Correction if exceeding current max HP and max SP
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
end