MZ Opacity change in action sequence "glitch"?

I made a camouflage skill for one of my enemies, which changes its opacity with a state. Then in its attack action sequences, I change the opacity with a plugin command back to 255 at the moment of the attack, and then back to smaller after the attack, if the enemy is state affected with the camouflage state.

The problem is that usually when the enemy is making their first attack after using the camouflage skill, the opacity doesn't temporarily go back to 255. Then when it makes the next attacks, the opacity does go to 255. However, this does not always happen, like sometimes if the enemy uses the camouflage skill again, the opacity goes to 255 even during the first attack made during it. But most of the times it doesn't.

Am I missing something, or is there some kind of glitch here? Pics below...I guess this isn't the biggest problem in the world, but would be nice to fix it.

EDIT: I fixed a couple of spots where I had written "go down", when I meant go to 255.

Spoiler
SkillQ.jpg

StateQ.jpg

CEventQ.jpg
That was nearly the first thing i had encountered when i tried a similar thing in my project for a sneak skill. when the action sequence goes off, it overwrites the same opacity value you set through the state. you can try to increase the amount of times the state sets the opacity (in MV, i just used apply, turn end, and action end), or have the action sequence store the previous opacity to some variable and then set it back afterwards
Hmmm, I'm not 100% sure we're talking about the same thing.

What I'm trying to do, is have my "stealth" enemy become visible during the action sequence during the moment it makes an attack. Like move to actor -> opacity to 255 -> attack -> opacity to 64 -> move to home.

It's working other than most of the times that back and forth opacity change during attack doesn't happen when the enemy makes its first attack when in that state (but sometimes it does work).
It could be an issue of changing the opacity at times when the battler isn't getting refreshed to actually display the change.

You could try manually calling it, see if it makes a difference, e.g.
Code:
command to change opacity
command for eval: user.refresh()
Tried that (had to change user to Battlemanager._subject in the script), but it didn't change anything.

Original thread: https://forums.rpgmakerweb.com/threads/opacity-change-in-action-sequence-glitch.165453/