MZ TP gained, base script

Where in the base scripts does it mention how much TP is gained when a actor/enemy is damaged? I lowered Max TP to 5, but it always refills when a charecter is damaged, and this kind of clashes with a battle mechanic im making

thankl you in advance

Edit: I think i found the relevant code, i just need to know how to change it. I'd like to make it so damage only "charges" between 1 and 2 TP, instead of it being based on damage, but still be affected by TCR

Game_Battler.prototype.chargeTpByDamage = function(damageRate) {
const value = Math.floor(50 * damageRate * this.tcr);
this.gainSilentTp(value);
Where in the base scripts does it mention how much TP is gained when a actor/enemy is damaged? I lowered Max TP to 5, but it always refills when a charecter is damaged, and this kind of clashes with a battle mechanic im making

thankl you in advance

Edit: I think i found the relevant code, i just need to know how to change it

Game_Battler.prototype.chargeTpByDamage = function(damageRate) {
const value = Math.floor(50 * damageRate * this.tcr);
this.gainSilentTp(value);
change 50 to 0, somehow we both had the same idea, i also make my maxTp to 5 and dont want any tp gain.

edit: also change the .regenerateTp function to 5*this.trg so that that 5 will be the base number for regeneration
change 50 to 0, somehow we both had the same idea, i also make my maxTp to 5 and dont want any tp gain.
but i edited and said i want it to only charge between 1 and 2
but i edited and said i want it to only charge between 1 and 2
then i dont know, i'm just a beginner 🙂. Maybe use random integer command and put 1 or 2 there, but i dont know how
why go in the script part at all?

the TP Charge Rate is a SP-Parameter that allows you to decide how large or small the TP gained by damage is.
As such it can be set differently for different actors by traits.

Original thread: https://forums.rpgmakerweb.com/threads/tp-gained-base-script.140881/