Play sound when enemy with specific state gets hit

Here's what I'm trying to do, some enemies have 'Armored' state which when attacked normally or other physical skills would have reduced damage. I opt to conceal the 'Armored' state pop up during battle and I'm trying to figure out if there's a troop event command that can play a sound when they get hit by specific attacks WHILE having an armored state?

There are some skills that can remove that state, hence will not play the sound or would play a different sound. Is this even possible with the engine?

I hope I made myself clear.

Thanks in advance guys!
I'm trying to figure out if there's a troop event command that can play a sound when they get hit by specific attacks WHILE having an armored state
AFAIK, nope. Youll need a plugin of some kind to have the game play a sound when an armored enemy takes a physical hit. Its easily doable with Yanfly's buffs & states plugin though
AFAIK, nope. Youll need a plugin of some kind to have the game play a sound when an armored enemy takes a physical hit. Its easily doable with Yanfly's buffs & states plugin though
I forgot to mention that I'm currently using Yanfly buffs and states plugin, I went to check the plugin again. I think it can be done with Custom Action effects if I'm not mistaken?

Could use some help with the code and implementation though.

So I should put it on the note of Armored state (?) under custom respond effect bracket?
Could use some help with the code and implementation though.
inside your react effect should look something like this

Code:
if (this.isPhysical())
  AudioManager.playSe({name:"Armor", volume:100, pitch:100});

from there, youd need a way so differentiate your physical skills that are exceptions. you could use a note tag for it and have <Break> in your armor breaking skills. then the react notetag could look like this
Code:
if (this.isPhysical()){
    if (this.item().meta.Break)
        AudioManager.playSe({name:"Break", volume:100, pitch:100});
    else
        AudioManager.playSe({name:"Armor", volume:100, pitch:100});
}
and the armor se plays when a physical non break attack lands, and the break one plays when a physical break one does
inside your react effect should look something like this

Code:
if (this.isPhysical())
  AudioManager.playSe({name:"Armor", volume:100, pitch:100});

from there, youd need a way so differentiate your physical skills that are exceptions. you could use a note tag for it and have <Break> in your armor breaking skills. then the react notetag could look like this
Code:
if (this.isPhysical()){
    if (this.item().meta.Break)
        AudioManager.playSe({name:"Break", volume:100, pitch:100});
    else
        AudioManager.playSe({name:"Armor", volume:100, pitch:100});
}
and the armor se plays when a physical non break attack lands, and the break one plays when a physical break one does

Its working wonderfully! Thanks.

I have another question though, is it possible I make it both apply to both Physical and Magical on the armor state? Say all magic attacks also have that 'armor' sound? The only skill type can perform break is physical so I'll leave it as is.

EDIT: Nevermind, I just put the first code below and changed it to (this.isPhysical()) ---> (this.isMagical())

Now that seems to be working! Thank you again!

Original thread: https://forums.rpgmakerweb.com/threads/play-sound-when-enemy-with-specific-state-gets-hit.167707/