Help Needed: Parametric HP Regeneration

I would like to have hp regeneration in my game that is based off of a set parameter, instead of a percentage, in this case, it is mdf, because it's a stat I won't be using for anything else.

I know hp regeneration is determined by the following:

 #--------------------------------------------------------------------------
  # * Regenerate HP
  #--------------------------------------------------------------------------
  def regenerate_hp
    damage = -(mhp * hrg).to_i
    perform_map_damage_effect if $game_party.in_battle && damage > 0
    @result.hp_damage = [damage, max_slip_damage].min
    self.hp -= @result.hp_damage
  end

So far I've been able to turn off the percentage function by using damage = -(100 * hrg).to_i, but adding in anything else doesn't seem to change anything, it just regenerates by the hrg rate. My goal is for the regeneration per turn to be 50% of the character's mdf. Any help is appreciated.
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
It should be

damage = -(self.mdf*0.5).to_i
It should be

damage = -(self.mdf*0.5).to_i
Thanks a ton, works like a charm!

Original thread: https://forums.rpgmakerweb.com/threads/help-needed-parametric-hp-regeneration.42262/