Idea for a state? :)

I have an idea for a state, and was wondering if I can potentially do it. Hmm... how to describe it?


Well... I guess it's this? Basically, I want to make a state called Tone Deaf (just as an example, I think it'd be cool to have one for Fire and Thunder too, maybe Overheated and Overcharged?). It lowers the power of the Sound Element, which I already have a way of doing so, thanks to Moogle_X's Element Boost (I'm SO glad I found that! Thank you so much, guys! 😀 ) by the user (or maybe it should raise it, since hearing a tone deaf person sing or play a song would hurt your ears?)... but also has a chance of hurting you or your allies as well, because your Sound element spells are "off-key" so to speak.
Yanfly's Buffs & States Core is an amazing plugin, especially with Lunatic Mode, which should make it easy to recreate this effect. Try putting this in the note tag for Tone Deaf using this plugin:


<Custom Confirm Effect>
if (this.item().damage.elementID === x) {
var chance = Math.random()*100;
if (chance < 25) {
var dam = user.mat * user.elementRate(x);
user.gainHp(-dam);
}
}
</Custom Confirm Effect>


Replace x with the ID of your sound element. Using this particular code, any sound-element attack by the user has a 25% chance of dealing sound damage to themselves equal to their magic attack.
I really wish I knew Javascript or whatever better so I could do Lunatic Mode stuff by myself and not have to constantly ask for help...


Still, thanks!

Original thread: https://forums.rpgmakerweb.com/threads/idea-for-a-state.61760/