How do I make variable numbers correspond to names?

Forgive me if this is well known and I just haven't looked hard enough, but I don't really know what else to do. I'm using SumRndmDde's HUD Editor, and one of the things I hope to accomplish with the editor is nameplates for the character that's currently talking. The way I hope to implement this is through a variable, where each value of that variable corresponds to a character's name, and depending on the variable's current value, the corresponding name is displayed. Thing is, I have no idea how to implement this, outside of some primitive-feeling eventing like constantly running if-else common events or having multiple names loaded on the HUD editor that change whether or not they're displayed depending on the variable.

Does anyone have any ideas?
Considering that the value must be listed starting from 1, then it would be like this to know the current name of the actor in the list:
$gameActors._data[1].name()
$gameActors._data[2].name()
$gameActors._data[3].name()

And to see the current value of a variable the function would be this:
$gameVariables.value(id)

Example of use:
$gameVariables.value(1)
$gameVariables.value(3)
$gameVariables.value(200)

So let's say the variable used would be 50, you would just do this:
JavaScript:
$gameActors._data[$gameVariables.value(50)].name()

See this thread for more information that can help you create your menus:
Considering that the value must be listed starting from 1, then it would be like this to know the current name of the actor in the list:
$gameActors._data[1].name()
$gameActors._data[2].name()
$gameActors._data[3].name()

And to see the current value of a variable the function would be this:
$gameVariables.value(id)

Example of use:
$gameVariables.value(1)
$gameVariables.value(3)
$gameVariables.value(200)

So let's say the variable used would be 50, you would just do this:
JavaScript:
$gameActors._data[$gameVariables.value(50)].name()

See this thread for more information that can help you create your menus:
Sorry, but could you please clarify? Where would I enter that? Do I enter it as a script call?
I'm sure it's possible to include scripts in that editor you said you're using:
I'm using SumRndmDde's HUD Editor

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-variable-numbers-correspond-to-names.179203/