Play a sound when "Action failed" in battle?

Is it possible to play a sound when an action fails in battle?
There are a few ways that in battle an action can fail and not be executed at all.
You know, when a skill has a success rate of <100% and it fails for example.

However, no sound is played and only a message appears in the battle log.

I'd like to play a sound whenever an action fails, just like when you miss or the enemy evades.
Are you, by any chance, using Yanfly plugins? If so, that would be quite easy to do with action sequence:

Code:
<target action>
    action effect
    if target.result().missed || target.result().evaded
        play soundMissed
    else
        play animation
    end
</target action>
I guess I should also explain a little more;
All of my skills actually have a success rate of 100%.

However, some time ago, I made a thread asking if I could make magical attack be affected by the user's hitrate. Here's the thread

This worked nicely. But as a result of changing the code like that, missing with a magical attack due to your hitrate caused the attack not to miss, but rather "fail".

And to get to the point, I basically want to make the "action failed" a substitute for missing with a magical attack, hence why I need the sound. So if possible I would like to make that a global change so that I don't have to change each and every skill and/or battler.

I am using some Yanfly plugins, but not all of them (most importantly, I don't use BattleEngineCore)
bumping
bumping²
Would that one plugin of yours help here @MushroomCake28? Im not sure so...
@Finnuval Nope. My only audio plugin currently is to change the recurring sound effects mid game (like cursor, buzzer, etc.). It doesn't add system sound effects unfortunately.
@Finnuval Nope. My only audio plugin currently is to change the recurring sound effects mid game (like cursor, buzzer, etc.). It doesn't add system sound effects unfortunately.
Okay, wasn't sure so tagging you was easiest xD
bumping³

Is it possible to play a sound when an action fails in battle?
There are a few ways that in battle an action can fail and not be executed at all.
You know, when a skill has a success rate of <100% and it fails for example.

However, no sound is played and only a message appears in the battle log.

I'd like to play a sound whenever an action fails, just like when you miss or the enemy evades.

I guess I should also explain a little more;
All of my skills actually have a success rate of 100%.

However, some time ago, I made a thread asking if I could make magical attack be affected by the user's hitrate. Here's the thread

This worked nicely. But as a result of changing the code like that, missing with a magical attack due to your hitrate caused the attack not to miss, but rather "fail".

And to get to the point, I basically want to make the "action failed" a substitute for missing with a magical attack, hence why I need the sound. So if possible I would like to make that a global change so that I don't have to change each and every skill and/or battler.

I am using some Yanfly plugins, but not all of them (most importantly, I don't use BattleEngineCore)

Original thread: https://forums.rpgmakerweb.com/threads/play-a-sound-when-action-failed-in-battle.123525/