[VXAce]Change charge TP by damage suffered

Hi, I make a script to change charge TP by damage suffered. When an enemy uses a skill, my actor's TP increase by 1 :

Spoiler
class Game_Battler  

  #--------------------------------------------------------------------------

  # * Charge TP by Damage Suffered

  #--------------------------------------------------------------------------

  def charge_tp_by_damage(damage_rate)

    self.tp += 1

  end

end
 

I would like to change this in function of type of attack. Examples : simple skills, TP+1 ; magic skills, TP+2 ; special skills, TP+3.

 

Can you help me, please ?
Topic to close.

Original thread: https://forums.rpgmakerweb.com/threads/vxace-change-charge-tp-by-damage-suffered.38573/