Hi! I'm currently creating a condition in the Troop Event by Scripting
For every 1% HP lost, gain +4% stats
Here is my code, I don't know where I went wrong or If I'm missing something
var e = $gameTroop.members()[0];
var lostHP_percent = 1-e.hpRate();
var bonusStats = (lostHP_percent * 0.04);
e.atk*=(1+bonusStats);
e.mat*=(1+bonusStats);
e.agi*=(1+bonusStats);
e.luk*=(1+bonusStats);
The "Attack" skill is has a formula, with 0 variance, set to "a.atk + a.mat"
The enemy has 200 atk and 200 mat so at 100% hp, it deals 400 damage
However, even when the HP is reduced, the 400 damage is constant throughout.
For every 1% HP lost, gain +4% stats
Here is my code, I don't know where I went wrong or If I'm missing something
var e = $gameTroop.members()[0];
var lostHP_percent = 1-e.hpRate();
var bonusStats = (lostHP_percent * 0.04);
e.atk*=(1+bonusStats);
e.mat*=(1+bonusStats);
e.agi*=(1+bonusStats);
e.luk*=(1+bonusStats);
The "Attack" skill is has a formula, with 0 variance, set to "a.atk + a.mat"
The enemy has 200 atk and 200 mat so at 100% hp, it deals 400 damage
However, even when the HP is reduced, the 400 damage is constant throughout.