How to make HP Regeneration affected by Recovery Effect

I tried change
Game_Battler.prototype.regenerateHp = function() { var value = Math.floor(this.mhp * this.hrg); value = Math.max(value, -this.maxSlipDamage()); if (value !== 0) { this.gainHp(value); } };


to
Game_Battler.prototype.regenerateHp = function() { var value = Math.floor(this.mhp * this.hrg * this.rec); value = Math.max(value, -this.maxSlipDamage()); if (value !== 0) { this.gainHp(value); } };
it not working and get replaced by rec actor, example the actor with 300 HP equip with item 100% HP Regen, then get state to reduce by 30% so it 70%, the regen should be 210 but it become 90.
it not working and get replaced by rec actor, example the actor with 300 HP equip with item 100% HP Regen, then get state to reduce by 30% so it 70%, the regen should be 210 but it become 90.
did you set the rec rate of the state to 30% or 70%? that trait is multiplicative. if it says 30%, its not reducing it BY 30%, its reducing it TO 30%, which would make the 90 hp regen make sense.

also you might want to add a little more logic. if that function is the same one that handles negative hp regeneration, then your rec reduction would also reduce negative regeneration
You are right, i forget it multiplicative 😅. ignore this thread
90 is exactly 30% of 300.

The javascript formula I don't understand, but I do know math and this is what I think has happened.
R = Regen
C = percentage to Cut / 100

I think you did:
Code:
R * C

What you should have done is:
Code:
R * (1 - C)

So, when your regen is 300, and you want to take 30% out, it will look like this:
Code:
300 * (1 - (30 / 100)) = 210

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-hp-regeneration-affected-by-recovery-effect.164305/