I don't know what version you're on (but it's still basically the same.)
I'm assuming you've already mirrored the code in the area. Something like this probably?
@cmdMap=-1
@cmdPhone=-1
@cmdJukebox=-1
@cmdNewcmd=-1
commands[@cmdMap=commands.length]=_INTL("Map")
commands[@cmdPhone=commands.length]=_INTL("Phone") if $PokemonGlobal.phoneNumbers && $PokemonGlobal.phoneNumbers.length>0
commands[@cmdJukebox=commands.length]=_INTL("Jukebox")
commands[@cmdNewcmd=commands.length]=_INTL("New CMD")
Now can I get your attention to the line for the Phone. You see the
if $PokemonGlobal.phoneNumbers && $PokemonGlobal.phoneNumbers.length>0
That makes it so the phone will only appear if the player has more than 1 phone number. We just need to add a condition to our command to do something similar (I'm gonna use a switch to activate it, but you can use a variable that your app is dependent on, if any)
@cmdMap=-1
@cmdPhone=-1
@cmdJukebox=-1
@cmdNewcmd=-1
commands[@cmdMap=commands.length]=_INTL("Map")
commands[@cmdPhone=commands.length]=_INTL("Phone") if $PokemonGlobal.phoneNumbers && $PokemonGlobal.phoneNumbers.length>0
commands[@cmdJukebox=commands.length]=_INTL("Jukebox")
commands[@cmdNewcmd=commands.length]=_INTL("New CMD") if $game_switches[XXX]