What is the code to add a debuff on a target?

Using Yanfly's Skill Core (http://yanfly.moe/2015/10/13/yep-8-skill-core/) to try and add a debuff on the target after a skill is used.

The format given is:

<Post-Damage Eval>
code
</Post-Damage Eval>

I can't find an answer anywhere, thanks in advance!
Try:
Code:
target.addDebuff(paramId, turns);
Replace paramId with a number from 0~7 indicating which parameter to affect: mhp, mmp, atk, def, mat, mdf, agi, luk respectively. Replace turns with the number of turns the buff should last. For example, to apply a 3-turn agi debuff:
Code:
target.addDebuff(6, 3);


...or, if your "debuff" is actually a state:
Code:
target.addState(7);
^ This will add state ID 7 to the target, change the number as needed. 🙂
Why not just use the skill "effects" box to add the debuff?
Try:
Code:
target.addDebuff(paramId, turns);
Replace paramId with a number from 0~7 indicating which parameter to affect: mhp, mmp, atk, def, mat, mdf, agi, luk respectively. Replace turns with the number of turns the buff should last. For example, to apply a 3-turn agi debuff:
Code:
target.addDebuff(6, 3);
Thanks so much! 🙂

Why not just use the skill "effects" box to add the debuff?
It's a move that hits a few times and I want the debuff to only be applied once, it was a bit of an overkill when it was applying a defense buff over and over after each hit lol


Edit: Tested it and it turns out this wasn't the solution I was looking for. It still applies the debuff after each hit >_>
You probably need to use a different notetag instead of the post damage eval.. Or use a check if the target already has a debuff

Original thread: https://forums.rpgmakerweb.com/threads/what-is-the-code-to-add-a-debuff-on-a-target.109057/