Button press to switch between picture displays during dialogue events.

For my game I gave players an item that when equipped acts like xray glasses. Currently its binary, you either have the item equipped and get the effect, or you dont have it equipped and everything appears as normal. A nice coder who played the game was explaining yesterday how it'd be possible using a pluggin to have a keybind button press switch between the images on the fly. They even did a small test in a new project and got it to work. I'm not that code savvy so I've been trying to adjust their code to work but I'm unsure how.

I'll paste their example text below. I'm using a Yanfly pluggin for the keybind effect but that's working fine. It's more I can't seem to get the rest to line up since I don't understand how it works. Hoping someone here might know better, or a different method to switch images mid event. The issue is I've drawn over a thousand images at this point so having them all listed in a common event to pull from would be hectic. Any help would be greatly appreciated. It's a minor thing, but it'd really make the game polish that much nicer.
#Common Event 0001

◆Erase Picture:#1
◆If:#0001 is ON
◆If:#0019 is OFF
◆If:#0020 is ON
◆Script:$gameScreen.showPicture(1, 'c_' + $gameVariables.value(0001) + '_alt', 0, 0, 0, 100, 100, 255, 0);
◆
:Else
◆Script:$gameScreen.showPicture(1, 'c_' + $gameVariables.value(0001), 0, 0, 0, 100, 100, 255, 0);
◆
:End
◆
:Else
◆If:#0020 is ON
◆Control Switches:#0020 = OFF
◆
:Else
◆Control Switches:#0020 = ON
◆
:End
◆Erase Picture:#1
◆If:#0020 is ON
◆Script:$gameScreen.showPicture(1, 'c_' + $gameVariables.value(0001) + '_alt', 0, 0, 0, 100, 100, 255, 0);
◆
:Else
◆Script:$gameScreen.showPicture(1, 'c_' + $gameVariables.value(0001), 0, 0, 0, 100, 100, 255, 0);
◆
:End
◆
:End
◆
:Else
◆If:#0020 is ON
◆Control Switches:#0020 = OFF
◆
:Else
◆Control Switches:#0020 = ON
◆
:End
◆
:End

#test npc

◆Control Switches:#0001 = ON
◆Control Variables:#0001 = 'Judae'
◆Common Event:#0001
◆Control Switches:#0019 = ON
◆Text:None, None, Window, Bottom
: :....
◆Erase Picture:#1
◆Control Switches:#0019 = OFF
◆Control Switches:#0001 = OFF
◆Control Variables:#0001 = 0
I'm afraid I'm not understanding exactly the problem that you're having, you said that you got it working, so what exactly isn't working?

Original thread: https://forums.rpgmakerweb.com/threads/button-press-to-switch-between-picture-displays-during-dialogue-events.155602/