MV [Buffs and States Core]Skill that consumes debuff stacks to deal bonus damage

A skill I'm working on should do bonus damage for every stack of the agility debuff present on the target. I skimmed around the plugin's guide, but couldn't find anything that tells you have to use the current buff or debuff stacks in calculations. I saw an example of one in use, but I want to be sure I'm extrapolating correctly. Currently the damage formula reads as following:

(a.atk*2)+(b._debuffs(6)*10)-b.def
well i have something along this line for my own game but its not 1 skill its broken into 2 skills

1 to asorbe buffs from monsters that then turns into a new buff on the character

2nd skill then uses those stacks to incress its damage bassed on the # of stacks

if you want i can post them lol. longs your using yanflys Buff and States core
well i have something along this line for my own game but its not 1 skill its broken into 2 skills

1 to asorbe buffs from monsters that then turns into a new buff on the character

2nd skill then uses those stacks to incress its damage bassed on the # of stacks

if you want i can post them lol. longs your using yanflys Buff and States core
I just need to know the function that returns the value of debuffs.
if (target.isStateAffected(stateId)) {
var stacks = target._states.filter(function(state) {
return state.id === stateId;
}).length;
damage += stacks * 50;
}

should work just change the ID to the ID of the state your looking for and you can change the damage multiplyed at the end to what you want this is assuming your using yanfly buff and state core aswell to add the stacks to the state as thats what this is checking for

also to clerify the damage at the end is multiplying by that number equal to the stacks so 2 stacks means 100damge 3 =150 and so on ontop the normal damage from the skill this way you can still use the skill regardless but customize it to your liking. If you would like to also change it at some point you could easily modify it to take all buffs or debuffs into count or just add 1 or 2 more to it

again as this is assuming your using the buff and state core you would put this in the note of the skill and use <Custom Apply Effect>
(a.atk*2) + Math.max(b._buffs[6]*-10, 0)-b.def

That formula should work.
should work just change the ID to the ID of the state your looking for
The OP is not looking for a state, she's talking about debuffs.

@KaitlynKitty - your thread title and your post say two different things. Your title mentions "consuming" the debuffs, which means they'd be gone after the attack resolves. Do you want that? Or do you just want to incorporate them into the damage calculation?
The OP is not looking for a state, she's talking about debuffs.

@KaitlynKitty - your thread title and your post say two different things. Your title mentions "consuming" the debuffs, which means they'd be gone after the attack resolves. Do you want that? Or do you just want to incorporate them into the damage calculation?
The consumption is a separate function(or rather consumption has two aspects, and I'm only asking for how to implement the other), because it would be inefficient to implement the removal of the debuff in the damage formula. Far better to just use built in remove debuff, unless that will only remove one stack?
No, that will do what you want - I was just checking because you mentioned it in the title then not during the thread. I wanted to make sure you knew how to do it.
No, that will do what you want - I was just checking because you mentioned it in the title then not during the thread. I wanted to make sure you knew how to do it.
Just to be sure, the damage formula calculates first, and then triggers the other effects, right? If it removes the debuff first, that would cause issues.
Correct, effects happen after any hit is resolved.

Original thread: https://forums.rpgmakerweb.com/threads/buffs-and-states-core-skill-that-consumes-debuff-stacks-to-deal-bonus-damage.157896/