Trying to Drain max hp per turn

hi there, curenntly trying to modifie max hp values throught the use of states. I want to have my character loses 20% max hp per turn when the status is applied and stops when the status when removed. i am using mz with the base vizustella plugins, any help is realty appreciated
If you're looking to reduce the max HP by 20% per turn, you'll have to change how HP regeneration works, as it's coded to give a value based on max HP. Currently it can restore or 'damage' based on max HP but it doesn't change the max HP value, if that makes sense.

I don't know how it looks in visustella since I don't use it, but the vanilla method is:

JavaScript:
Game_Battler.prototype.regenerateHp = function() {
    const minRecover = -this.maxSlipDamage();
    const value = Math.max(Math.floor(this.mhp * this.hrg), minRecover);
    if (value !== 0) {
        this.gainHp(value);
    }
};
If you're looking to reduce the max HP by 20% per turn, you'll have to change how HP regeneration works, as it's coded to give a value based on max HP. Currently it can restore or 'damage' based on max HP but it doesn't change the max HP value, if that makes sense.

I don't know how it looks in visustella since I don't use it, but the vanilla method is:

JavaScript:
Game_Battler.prototype.regenerateHp = function() {
    const minRecover = -this.maxSlipDamage();
    const value = Math.max(Math.floor(this.mhp * this.hrg), minRecover);
    if (value !== 0) {
        this.gainHp(value);
    }
};
Sweet thanks for your help.
You may also need to work with mhp. The script call for that is param(0).

A state as you may or may not know can further affect the maximum value(actually change it), and thats done by Traits -> Parameter: Max HP. With the new maximum being the result of MaxHP * Pct(Ex. 1900 x 0.5 = 950). I've no way of knowing how to make it turn based, turns are only duration. This is why that code I supplied above might be the right direction. Regeneration applies at every turn.

One last thing you need to be aware of incase you've tried setHp(). Under the hood it restricts changes to the maximum(you can't set hp higher than the maximum) but it doesn't lower the maximum, only the current HP.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-drain-max-hp-per-turn.139276/