Skill that does more damage the more debuffs the target have?

I am wondering, how can I make a skill that does more damage the more debuffs the target have?

For example, I want a skill when the target that have more debuffs (3, for example,) receive more damage than the target that have less debuff (1, for example). How do I do this? Do I need to install a script, or do I need to write formulas?
This is from a yanfly's Tips and tricks video, you can find it here:


I've changed it a bit so it only deals Hp damage, the formula in Red means how much damage will the target receive for each debuff. This edit changes these things from yanfly's original idea so it fits your request:

-It shouldn't check for buffs (tho I'm not sure 100%, try it and you tell me 😅)
- I deals damage for each debuff.
-It shoulnd't remove or clear them

You'll need these plugins to make it work:

Battle engine core: http://yanfly.moe/2015/10/10/yep-3-battle-engine-core/
Skill core: http://yanfly.moe/2015/10/13/yep-8-skill-core/

My last suggestion is you should have the skill deal at least 1 damage or debuff the target, because the damage from the formulas below will occur after the skill's formula box happens. Anyways, test it if you want and you tell me. It should work and do what you wanted, but in case it doesn't, as I can't test it now, write me and I'll fix it, I'm pretty sure I can make it work 😉.

<After Eval>
// Initialize the HP value.
var hp = 0;
// Loop through all 8 parameters.
for (var i = 0; i < 8; i++) {
// If it is a debuff...
if (target._buffs < 0) {
// Then increase the damage by a formula.
hp -= user.mdf * 2;
}
// Check if the HP change is negative...
} if (hp < 0) {
// Play an animation.
target.startAnimation(animation Id from your animations list here);
}
// Check if the HP amount isn't 0...
if (hp !== 0) {
// Alter the target's HP.
target.gainHp(hp);
// Start the damage popup for the target.
target.startDamagePopup();
}
// Clear the target's results.
target.clearResult();
</After Eval>
'Game Mechanics Design' is for looking at aspects of game play at a more conceptual level. "How do I...?" (implementation) questions belong in the Support forum for the engine you are using. Apart from keeping those aspects separate, it also helps prevent things like gambitben's response which is for MV and the information under your avatar says you are using VXAce.

Moved to: RPGMaker VXAce
A damage formula should suffice.

dmg = a.atk * 4 - b.def * 2; dmg * (1 + (0..7).to_a.select {|id| b.debuff?(id)}.size)
This is from a yanfly's Tips and tricks video, you can find it here:


I've changed it a bit so it only deals Hp damage, the formula in Red means how much damage will the target receive for each debuff. This edit changes these things from yanfly's original idea so it fits your request:

-It shouldn't check for buffs (tho I'm not sure 100%, try it and you tell me 😅)
- I deals damage for each debuff.
-It shoulnd't remove or clear them

You'll need these plugins to make it work:

Battle engine core: http://yanfly.moe/2015/10/10/yep-3-battle-engine-core/
Skill core: http://yanfly.moe/2015/10/13/yep-8-skill-core/

My last suggestion is you should have the skill deal at least 1 damage or debuff the target, because the damage from the formulas below will occur after the skill's formula box happens. Anyways, test it if you want and you tell me. It should work and do what you wanted, but in case it doesn't, as I can't test it now, write me and I'll fix it, I'm pretty sure I can make it work 😉.

<After Eval>
// Initialize the HP value.
var hp = 0;
// Loop through all 8 parameters.
for (var i = 0; i < 8; i++) {
// If it is a debuff...
if (target._buffs < 0) {
// Then increase the damage by a formula.
hp -= user.mdf * 2;
}
// Check if the HP change is negative...
} if (hp < 0) {
// Play an animation.
target.startAnimation(animation Id from your animations list here);
}
// Check if the HP amount isn't 0...
if (hp !== 0) {
// Alter the target's HP.
target.gainHp(hp);
// Start the damage popup for the target.
target.startDamagePopup();
}
// Clear the target's results.
target.clearResult();
</After Eval>

Err, I uses RPG VX Ace, not MV...

A damage formula should suffice.

dmg = a.atk * 4 - b.def * 2; dmg * (1 + (0..7).to_a.select {|id| b.debuff?(id)}.size)

I've tried these, but they didn't work. I attack the first time, which damages enemy 195. The second, with 1 debuffs, damages enemy 173, the third with 3 debuffs damages enemy 162...
Hm... are you aware of the distinction between buffs and states?
Hm... are you aware of the distinction between buffs and states?
what's that?
Hm... are you aware of the distinction between buffs and states?
what's that?
...

What are these "debuffs" that you want to check for?
...

What are these "debuffs" that you want to check for?
Bleed, which damages enemy like poison. Exposed, blind, bleeding eyes, unbalance, knocked-down, stun, paralize, and poison.
States:
6iQ49lG.png


Buffs/Debuffs:
VhtmpEi.png


When you add a buff, you increase a param by 25% each time (up to 2 times) or -25% in case of a debuff
This can be addressed with a similar formula, but I don't have time right now.
Luckily for me it sounds a lot easier to just count the number of states. I think this should work:

dmg = a.atk * 4 - b.def * 2; dmg * (1 + b.states.size)
Thanks!
@Waveclaw If the query is resolved please Report your opening post and ask for it to be closed .
Thanks
Okay!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/skill-that-does-more-damage-the-more-debuffs-the-target-have.94372/