Looking for js code that affects battler opacity

Hey, all. First post. New here, still new to rpg maker so I hope this is posted in the right place and not too dumb a question.

I'm stuck on something I feel should be very simple, but I can't seem to find the info I need to make it work. Here's what I'm trying to do. I'm making a skill called "Vanish" that's supposed to work as follows: User opacity changes to 20%; user becomes harder to hit; when skill wears off (after 3 turns or due to damage) user opacity returns to normal.

It's the opacity that I'm having trouble with. The way I have it set up, using the skill sets the user opacity to 20% (yanfly action seq pak 2) and adds a state called "vanish" to the user. The state lasts 3 turns and has a chance to come off with damage. What I need is javascript code that will reset the users opacity to 100% when the state ends. I'm certain this can be done with Yanfly's BuffsStatesCore using <Custom Remove Effect> in the state notes. I just don't know the js code (or where to find it) that will set my battlers opacity back to 100%. Any help would be greatly appreciated!
This will do it:

Code:
<Custom Remove Effect>
this.spriteOpacity(255,20)
</Custom Remove Effect>

Keep in mind though, that if you have any action sequences that change opacity, that also return opacity to normal, your vanished actor will go back to normal opacity at the end of the sequence. I haven't found a good way to resolve this.
This will do it:

Code:
<Custom Remove Effect>
this.spriteOpacity(255,20)
</Custom Remove Effect>

Keep in mind though, that if you have any action sequences that change opacity, that also return opacity to normal, your vanished actor will go back to normal opacity at the end of the sequence. I haven't found a good way to resolve this.

Thanks much for your help!

Original thread: https://forums.rpgmakerweb.com/threads/looking-for-js-code-that-affects-battler-opacity.81552/