Help with creating a randomized dialogue pool that removes dialogues after it's been triggered? (RMMV)

So I'm trying to create a dialogue system akin to Hades', where the NPC's will have something to say based on a randomized variable (something like var = random number, then if var = x, then message x will show up).
But I want to remove the dialogue from the pool after the player triggered it. Any ideas on how to do it?
1620050925961.png

Note that this is a really quick-and-dirty implementation; I imagine that changing maps will end up breaking this because it'll think the events with the same IDs on the new map have the same dialogue choices, but it should be an illustrative example of how you'd approach the problem, at least.
You can make the dialogue set a self-switch on the event, then the actual obtaining the random dialogue number is in a loop that iterates until you get a number that hasn't been switched.

This could be more efficient using some script calls, but I'm presuming you don't know any JavaScript, so I'll show you how to do it entirely with event commands. Where I use the Control Variable, just use any variable number you have free.

Code:
Loop
  Control Variable -> Random 1-5
  Conditional Variable = 1
    Conditional Self Switch A is OFF
      Do your dialogue
      Control Self Switch A ON
      Break Loop

do the same for 2/Self Switch B, 3/Self Switch C, 4/Self Switch D, then dialogue 5 is always available (doesn't have a self switch condition) so you won't loop infinitely.

Code:
End Loop
This tutorial covers randomness in dialogue, with and without replacement~

Original thread: https://forums.rpgmakerweb.com/threads/help-with-creating-a-randomized-dialogue-pool-that-removes-dialogues-after-its-been-triggered-rmmv.136143/