Hiding a state's icon with Javascript? *SOLVED*

Hello!

I'm trying to see if there's a way to hide specific state's icon with java script or some other non-complicated way.

I want the state to still function as normal, just that the player cannot see the icon for the state UNLESS they have a specific skill. Initially, I had 2 states for each state, one with an icon, and one without. However, implementing a duplicate for each state is quickly becoming tedious, and I can see it causing confusion/ bugs with future implementations.

I saw this forum post asking a similar thing, but it never got solved. Hopefully someone will be able to help resolve this issue.
https://forums.rpgmakerweb.com/index.php?threads/hide-state-icons-in-battle-only.151275/

Any help would be very much appreciated. I have spent a lot of time trying to figure this out on my own.
There is a plugin in this post https://forums.rpgmakerweb.com/inde...-the-state-icon-anchor-of-each-battler.99570/ that allows you to adjust the position of the state icons in battle. You could maybe adjust the state icon off the screen to "hide" it?
There is a plugin in this post https://forums.rpgmakerweb.com/inde...-the-state-icon-anchor-of-each-battler.99570/ that allows you to adjust the position of the state icons in battle. You could maybe adjust the state icon off the screen to "hide" it?
I took a look at this plugin.

So this works as intended, even though its made for MV. However, its not what I'm looking for. On the right track though.

The plugin works by setting the position of a specific state's icon for a specific actor permanently. It wouldn't change whether I had the skill or not. I need more of an active way of hiding the icon, like a script call.

Thank you for finding this though, I needed something like this for another part of my game and I may end up using it!
You can change the icon with just $dataStates[id].iconIndex = X;
So you can set it to empty icon slot to hide it. But I think that will only persist for the duration of your game being open(?). So you'll have to think how to build with that in mind, or find another solution.
You can change the icon with just $dataStates[id].iconIndex = X;
So you can set it to empty icon slot to hide it. But I think that will only persist for the duration of your game being open(?). So you'll have to think how to build with that in mind, or find another solution.

Ahh. thank you! It seems to be working like I would want!

For future reference, I have only tested this in battle menu's. The way my command menu is configured, you cannot see the state icons anyway. It should work if you have a parallel event running this setup I linked below.

1747678446292.png


Thank you guys for the help and suggestions, I figured the solution would be easy, I just don't have the Java knowledge.

Original thread: https://forums.rpgmakerweb.com/threads/hiding-a-states-icon-with-javascript-solved.177788/