A lot of the scrips for this are a bit more complicated. I just wanted something super simple and easy to understand, but I couldn't find it. I think the context is self-explanatory, but feel free to ask a question.
For reference:
Ruby:
# replaces %n hp damage with constant damage n
# Also wotks for MP and TP, just change the letters
# !NOTE! removes = vars "@result.hp_damage", and "damage".
# Obvs if something else uses those vars it won't work right
class Game_Battler < Game_BattlerBase
def regenerate_hp
self.hp += hrg*100
#perform_map_damage_effect if $game_party.in_battle #uncomment if you want screen flash
end
end
For reference: