[ACE] Fixing the enemy letters for hidden/transformed enemies?

Say you were creating instances where enemies became conditionally hidden or transformed into other enemies at the start of battle. The letters of all other enemies would remain the same.

So if you had Skeletons A-E and Skeleton A became hidden and Skeleton C turned into a Ghost, Skeletons B, D, and E would retain their original letters.

I tried at the end of the transform/hide process

$game_troop.members.each {|mem| mem.letter = ""} $game_troop.make_unique_namesbut that just made the names Skeleton F, Skeleton G, and Skeleton H.

How could I make it so that in that instance, the Skeleton's names would properly match their indexes relevant to the number of active skeletons in the troop, and soforth?
Bump
You're on the right track. You just need to reset the hash that determines how many times a name has been used. The hash doesn't have a public method, so I just made a quick little function to reset the names.

Place the following in the materials section of the script editor

Code:
class Game_Troop < Game_Unit  #--------------------------------------------------------------------------  # * Reset Names  #--------------------------------------------------------------------------  def reset_names    @names_count = {}    members.each {|mem| mem.letter = ""}     make_unique_names  endend
Then use
Code:
$game_troop.reset_names
in a script call after you've done your transform/hide events.

Original thread: https://forums.rpgmakerweb.com/threads/ace-fixing-the-enemy-letters-for-hidden-transformed-enemies.43335/