Can you reset a self switch of an event by reloading a map?

I have an interactive NPC in my game, and I want the NPC to perform a specific action only once, when interacted with. After the interaction, I set a self-switch to ON. However, I also want the ability to reset this self-switch when you reload the map so that players can interact with the NPC again when they leave and return to the map.
What would be the best way to do this? I thought about "erase event", but I want the NPC to remain there.
The second page has the same graphic as the NPC, right?
Use Common Switch for all NPCs and turn them off in the transport event that returns to this map.

In this example I used Switch 10 to 20 for 10 NPCs on map 0002, on the map that takes me to this I deactivate the 10 Switches in batch before accessing the map:
1708644109280.png
If this is going to be applied to more than one NPC, you'd probably want a script for convenience. Throw this in your scripts list (anywhere below Scene_Debug and above Main, as usual)
Ruby:
class Game_Event < Game_Character
  alias init_for_reset_ss initialize 
  def initialize(map_id, event)
    if event.name =~ /\\reset_ss/
      ('A'..'E').each do |letter|
        key = [map_id, event.id, letter]
        $game_self_switches[key] = false if $game_self_switches[key]
      end
    end
    init_for_reset_ss(map_id, event)
  end
end
In your map event, put this somewhere in its name
Code:
\reset_ss
Now whenever you go to a different Map ID and come back, this event will set all of its self-switch letters OFF.

Original thread: https://forums.rpgmakerweb.com/threads/can-you-reset-a-self-switch-of-an-event-by-reloading-a-map.166062/