Create a DoT state that can reduce HP to 0

I wanted to create a "bleeding" state, which as follows :

Reduce HP each turn based on the missing HP.
The more missing HP, the more damage received.
This state can reduce HP to 0.

I'm using yanfly DoT extension plugins/states core plugins.
Anyone can help would be appreciated. Regards
Any state with negative regeneration can reduce HP to zero and kill - as long as you set the engine to allow kills by slip damage, that is one of the settings in the database on the system tab. If that is not allowed, negative regeneration stops at HP=1.
This makes the DOT deal 10% more damage for every 10% of HP that is missing.

<Custom Regenerate Effect>
var damage = Math.round(DAMAGE FORMULA HERE * (1 + (1 - user.hpRate())));
if (damage > 0) {
user.gainHp(-damage);
user.startDamagePopup();
user.clearResult();
}
</Custom Regenerate Effect>
Any state with negative regeneration can reduce HP to zero and kill - as long as you set the engine to allow kills by slip damage, that is one of the settings in the database on the system tab. If that is not allowed, negative regeneration stops at HP=1.

I aware of the setting in the database, but it is a global setting. I have a poison state that stops at 1 HP. meanwhile bleeding can kill the characters.

This makes the DOT deal 10% more damage for every 10% of HP that is missing.
Syntax error occured. How do I write the "Damage formula"?
this is my current formula :
<Custom Regenerate Effect>

var damage = Math.round( * (1 + a.atk * 4 - b.def * 2 + (1 - user.hpRate())));

user.gainHp(-damage);

user.startDamagePopup();

user.clearResult();

}

</Custom Regenerate Effect>
<Custom Regenerate Effect>
var damage = Math.round(((1+ (origin.atk*4 - user.def*2)) * (1 + (1 - user.hpRate())));
if (damage > 0) {
user.gainHp(-damage);
user.startDamagePopup();
user.clearResult();
}
</Custom Regenerate Effect>

You gotta use "user" - "origin" and "target" for yanfly's buffs&states core.
In this case, "Origin" refers to the one who put the state on the target, and "user" it the one WITH the state on them.
Fernyfer775 said:
You gotta use "user" - "origin" and "target" for yanfly's buffs&states core.
In this case, "Origin" refers to the one who put the state on the target, and "user" it the one WITH the state on them.

This isn't necessarily true; my Blood Seal state has to have "(user.gainHp)" to work, and said state is on an enemy.

Anyway, I think what OP needs is a check that the DoT effect is more or less than the target's current HP and set the result to 1 if less or equal to it.

<Custom Regenerate Effect>
var damage = Math.round((1 + origin.atk * 4 - user.def * 2 + (1 - user.hpRate())));
if (damage > 0 && user.hp > damage) {
user.gainHp(-damage);
user.startDamagePopup();
user.clearResult();
} else if (user.hp <= damage) {
damage = user.hp - 1
user.gainHp(-damage);
user.startDamagePopup();
user.clearResult();
}
</Custom Regenerate Effect>
It works properly. thanks.

Original thread: https://forums.rpgmakerweb.com/threads/create-a-dot-state-that-can-reduce-hp-to-0.95665/