[Help] Applying a chance to inflict a debuff on skills/items

As title says.

I wanna make skills where they have a chance to inflict a debuff (ATK, DEF, MATK, MDEF, AGI, LUK) on a successful hit. MV's current option is to apply a debuff 100% of the time that skill hits (which is not something I want). An answer from an old thread says that I should just use states (as I can put chance in those), but the problem with that is that states do NOT stack when a skill would reapply it.

I do have all of the YEP Library, so I welcome any options answered using it. I am also open to using other plugins if my request have to be solved that way as well.
Here's how to add a random debuff after hitting an enemy, using Yanfly's Skill Core:
Code:
<After Eval>
if (result.isHit()) {
  var Params = [];
  // Insert Parameter ID's you want to debuff (in that case, ATK to LUK)
  Params.push(2, 3, 4, 5, 6, 7);
  // Randomly select the debuff
  var id = Params[Math.floor(Math.random() * Params.length)];
  // Input the debuff's duration
  var turns = 5;
  // Add the debuff to the target
  target.addDebuff(id, turns);
}
</After Eval>
Oooh! I like this effect, though it's not what I'm looking for.

What you gave me was to apply a random debuff on a target. What I'd like is to have a chance of apply 1 debuff on a successful hit. I may be able to work with this code, so I thank you regardless~

EDIT: So I'm sure I'm doing something wrong, but I'm unable to land my debuff. Here's the code I frankenstein'd (I have very limited JS skills... TwT):

Code:
<After Eval>
if (result.isHit()) {
  var mDefDownRate = 0.7;
  if (Math.random() < mDefDownRate) {
    var turns = target.buffTurns(5);
    turns = Math.max(3, turns);
    target.addDebuff(5, turns);
  }
}
</After Eval>
First of all, do you have Yanfly's Skill Core installed? If you had multiple Yanfly plugins, are they installed in the right order?
This should do it:
Code:
<After Eval>
if (result.isHit() && Math.random() < 0.7) target.addDebuff(5, 3);
</After Eval>

Now I'm guessing you want a 70% chance to apply debuff id 5 (mdf) for 3 turns?
First of all, do you have Yanfly's Skill Core installed? If you had multiple Yanfly plugins, are they installed in the right order?
Yes, I have Skill Core installed. Below is how I've installed my plugins, and I've confirmed they are correct as per Yanfly's wiki.
plugins01.jpgplugins02.jpgplugins03.jpg
This should do it:
Code:
<After Eval>
if (result.isHit() && Math.random() < 0.7) target.addDebuff(5, 3);
</After Eval>

Now I'm guessing you want a 70% chance to apply debuff id 5 (mdf) for 3 turns?
Yes I do! However, I still can't seem to make it work. orz
I can bump this now, right...?

Original thread: https://forums.rpgmakerweb.com/threads/help-applying-a-chance-to-inflict-a-debuff-on-skills-items.120347/