[VX Ace] Changing TP charge by damage formula

Hello. I'd like to change TP charge formula when target receives damage. The idea is basically the same, but adding LUK to the formula. For example, if the user has 20 of LUK, the TP gained would be a 20% of the original formula. Does someone know how to change this? Thank you
There should be a plenty of TP Manager script around the internet. Have you tried to search them?
I don't know if any of them allows you to create a custom formula, but if no one suits your need, it should be easy for anyone to make
There should be a plenty of TP Manager script around the internet. Have you tried to search them?
I don't know if any of them allows you to create a custom formula, but if no one suits your need, it should be easy for anyone to make

I used Dekita's Statistic Formulas script (because I'm using his stats menu script as well) and there is a problem: It doesn't let me to multiplicate base (TCR) by the formula I want to (in this case LUK / 100.0), it adds it so if, for example, my character has 20 of LUK the TCR is 120% instead of 20% (assuming of course base TCR is the default of 100%)
That dekita's scripts looks complex, i have no idea what's going on there.
But anyway, you can try to edit yourself, here (taken from default script)
Code:
class Game_Battler
  def charge_tp_by_damage(damage_rate)
    self.tp += 50 * damage_rate * tcr # <-- edit here
  end
end
Explanation :
  • 50 is the base TP
  • damage rate is how much you take the damage based on your max HP. The value ranged from 0.0 to 1.0. If an enemy deals 50% of your max HP, then it's 0.5. By that means, you will generate 25 TP from taking 50% from your max HP
  • TCR is the TP Charge Rate. The default value is 1.0 unless you changed it from the database
Now you want to add luck (or maybe want to completely remove TCR, is up to you). The formula would be
Code:
 self.tp += 50 * damage_rate * tcr * (luk/100.0)
Thank you, it works, it can be closed now
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-changing-tp-charge-by-damage-formula.91731/