State that wears off when character attacks

I would like to make a state that wears off when the character affected by the skill attacks, not is attacked. Is there any way to do this?
Yeah, there are ways to do it. Are you currently using any plugins? And do you have an objection to plugin-based solutions? And by "attack" do you mean when they use the basic attack command only? Or also when they use any type of damaging skill/spell? Or also when they use any skill/spell period?
Yeah, there are ways to do it. Are you currently using any plugins? And do you have an objection to plugin-based solutions? And by "attack" do you mean when they use the basic attack command only? Or also when they use any type of damaging skill/spell? Or also when they use any skill/spell period?
I'm not using any plugins rn, and I'd like it to wear off when the character uses any attacking skill as well as basic attack.
If you mean like the Hide state, you can put "Remove state: Hide" in all your Attacks. Though I don't know if that would negate any kind of sneak attack extra damage as you would no longer be hidden once the attack goes off. This assumes that this would target the actor and not the bad guy, in which case... whoops =/

I managed this in MV somehow, but I forget how and no longer have access to my old database =(
The plugin-free way to do this is to add a common event to every skill that you want this to apply to, and in that common event, make a conditional that checks if the user is affected by that state, and if so, to remove it.

If you are open to a plugin-oriented method, then you could probably use VisuStella Battle Core (or something similar) and use a JavaScript tag in the note box of your State to make it remove itself after damage is dealt. Something like:

Code:
<JS Post-Damage as User>
  user.removeState(stateID);
</JS Post-Damage as User>

You'd replace stateID with the numerical ID of the state (excluding any leading zeros).

Original thread: https://forums.rpgmakerweb.com/threads/state-that-wears-off-when-character-attacks.144034/