Crumbling Floor Puzzle for MV

Recently I moved my game from VX Ace to MV, but I can't adapt this old script to it. Is it any way to make a puzzle that triggers an event when all tiles have been stepped on, and each tile may only be stepped on once, without relying on too many switches?

This is the original vx ace script
Is this what you're asking for a translation of?
Ruby:
(1..21).each do |event_id|
    $game_self_switches[[@map_id, event_id, 'A']]
end

The page you linked actually has a translation of that into JavaScript:
JavaScript:
for (var event_id = 1; event_id <= 21; event_id++){
    $gameSelfSwitches.setValue([$gameMap.mapId(), event_id, 'A'], false);
}

Or is there something else you need help with? If so, please be more specific.
Is this what you're asking for a translation of?
Ruby:
(1..21).each do |event_id|
    $game_self_switches[[@map_id, event_id, 'A']]
end

The page you linked actually has a translation of that into JavaScript:
JavaScript:
for (var event_id = 1; event_id <= 21; event_id++){
    $gameSelfSwitches.setValue([$gameMap.mapId(), event_id, 'A'], false);
}

Or is there something else you need help with? If so, please be more specific.
No,yes. I saw it. And I saw what was the problem too.
The events id didn't match the ones in the game. Fixed it.

Original thread: https://forums.rpgmakerweb.com/threads/crumbling-floor-puzzle-for-mv.178410/