SOLVED: Status Infliction Based on Weapon Equipped

So I have a skill idea, but I can't quite figure out a way to implement it. Daggers in the game all have a very slight percentage of inflicting a status ailment (So one dagger might inflict silence, another dagger might inflict poison, etc.) But I would like a skill that would guarantee an infliction the status ailment tied to the equipped weapon so that when it's off cooldown you aren't tied to RNG 100% of the time. 15 turns and still no Silence on that deadly skeleton mage? Use this skill and boom! Silence applied. Are there any ways to go about this? Perhaps with Lunatic coding, or damage formula box? Plugin uggestions are welcome as well, I'm open to any avenues that can achieve this goal. Thanks in advance! ^^
This post right here: Damage Formulas 101 MV Edition is a godsend.
Something like:
Code:
a.hasWeapon($dataWeapons[ID]) ? Formula or addState : Formula
ID of course being the number the weapon is in the database.
If I'm reading this right, what your after is something that will take, say, this weapon:

dU45x9z.png


and allow its status effects to be applied at 100% of the time rather than the bad-RNG rates shown.

No plugin necessary, just put this into the damage formula box of your 100% apply skill:

Code:
c = a.allTraits().reduce(function(r, obj){ return obj.code === 32 ? r.concat(obj.dataId) : r; }, []); for (i in c) b.addState(c[i]); YOU_DAMAGE_FORMULA_HERE

Don't forget to replace YOU_DAMAGE_FORMULA_HERE with your actual damage formula.

Note that this guaranteed status application effect isn't restricted by weapon type, so in this case, you'll probably want to set the skill to work with daggers only.

Edit: In hindsight, I of course did it the hard way:

Code:
c = a.attackStates(); for (i in c) b.addState(c[i]); YOU_DAMAGE_FORMULA_HERE

That's basically the same thing, except less ugly.
If I'm reading this right, what your after is something that will take, say, this weapon:

dU45x9z.png


and allow its status effects to be applied at 100% of the time rather than the bad-RNG rates shown.

No plugin necessary, just put this into the damage formula box of your 100% apply skill:

Code:
c = a.allTraits().reduce(function(r, obj){ return obj.code === 32 ? r.concat(obj.dataId) : r; }, []); for (i in c) b.addState(c[i]); YOU_DAMAGE_FORMULA_HERE

Don't forget to replace YOU_DAMAGE_FORMULA_HERE with your actual damage formula.

Note that this guaranteed status application effect isn't restricted by weapon type, so in this case, you'll probably want to set the skill to work with daggers only.

Edit: In hindsight, I of course did it the hard way:

Code:
c = a.attackStates(); for (i in c) b.addState(c[i]); YOU_DAMAGE_FORMULA_HERE

That's basically the same thing, except less ugly.
Thank you so much! That's EXACTLY what I was looking for <3

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/solved-status-infliction-based-on-weapon-equipped.113397/