Create DOT state that increase DOT/stat over turn

might be confused with the title, but here.

I want to make negative state increase damage if didn't immediately take care of it.

for example, Poison= Base: 2% b.mhp
if the poison didn't get treated immediately, it will increase by 1% every turn.
so, 1st = 2%, 2nd = 3%, 3rd = 4%, and onward.

also apply to parameter, like rage state continue to increase dmg but decrease defense for each turn pass

is there any plugin or code to do it?
I am not sure but you should be able to hack at it by using common events
I think you could do this with Yanfly's Buffs & States Core plugin:
With that, you could try copy+pasting this into the state's notebox:
JavaScript:
<Custom Apply Effect>
// Initialise counter
user._poisonMult = 2;
// Display counter on state icon (optional)
user.setStateCounter(stateId, '' + user._poisonMult + '%');
</Custom Apply Effect>

<Custom Regenerate Effect>
// Calculate damage
var dmg = user._poisonMult * user.mhp / 100;
// Apply damage
user.gainHp(-Math.round(dmg));
// +1 to counter
user._poisonMult += 1;
// Update displayed counter (optional)
user.setStateCounter(stateId, '' + user._poisonMult + '%');
</Custom Regenerate Effect>
These notetags will (in theory) handle all the state's damage, so you don't need any -HP regen traits on the state. Also make sure to save your project after making changes in the Plugin Manager, otherwise those changes will not be seen during play.

[Edit: replaced var dmg = user.hpRate() * user._poisonMult; with correct line. 😅]
I think you could do this with Yanfly's Buffs & States Core plugin:
With that, you could try copy+pasting this into the state's notebox:
JavaScript:
<Custom Apply Effect>
// Initialise counter
user._poisonMult = 2;
// Display counter on state icon (optional)
user.setStateCounter(stateId, '' + user._poisonMult + '%');
</Custom Apply Effect>

<Custom Regenerate Effect>
// Calculate damage
var dmg = user.hpRate() * user._poisonMult;
// Apply damage
user.gainHp(-Math.round(dmg));
// +1 to counter
user._poisonMult += 1;
// Update displayed counter (optional)
user.setStateCounter(stateId, '' + user._poisonMult + '%');
</Custom Regenerate Effect>
These notetags will (in theory) handle all the state's damage, so you don't need any -HP regen traits on the state. Also make sure to save your project after making changes in the Plugin Manager, otherwise those changes will not be seen during play.

handle all state dmg. if want to change the var hp dmg, change {user._poisonMult = X;} / {user._poisonMult += X;}? while X as the var number?

add: the increase dmg work, but the exact dmg deal are not right. 2000 hp, 2% = 2
handle all state dmg. if want to change the var hp dmg, change {user._poisonMult = X;} / {user._poisonMult += X;}? while X as the var number?
😅 I'm not sure what you're asking, so here's some more detailed explanations:
  • var dmg = stuff;
    "Make a temporary variable called dmg and set it equal to stuff."

  • user._poisonMult = 2;
    "Define a variable called _poisonMult for the state bearer and set it equal to 2."

  • user._poisonMult += 1;
    "Add 1 to the bearer's _poisonMult value."
add: the increase dmg work, but the exact dmg deal are not right. 2000 hp, 2% = 2
😅 Oops, yes, I multiplied it by the wrong thing, sorry! Try this line instead:
JavaScript:
var dmg = user._poisonMult * user.mhp / 100;
I'll edit this into my previous post~
😅 I'm not sure what you're asking, so here's some more detailed explanations:
  • var dmg = stuff;
    "Make a temporary variable called dmg and set it equal to stuff."

  • user._poisonMult = 2;
    "Define a variable called _poisonMult for the state bearer and set it equal to 2."

  • user._poisonMult += 1;
    "Add 1 to the bearer's _poisonMult value."

😅 Oops, yes, I multiplied it by the wrong thing, sorry! Try this line instead:
JavaScript:
var dmg = user._poisonMult * user.mhp / 100;
I'll edit this into my previous post~

the explanation is enough for me to get it. and the damage is working now.
thank you for helping again.

Original thread: https://forums.rpgmakerweb.com/threads/create-dot-state-that-increase-dot-stat-over-turn.130618/