From within the script if you use strnpcinfo(3) that will reference the NPC's unique name, and in duplicated NPCs, that will be the unique name of the duplicate NPC.
If you're planning on accessing variables of other NPCs on the map or triggering event labels in other NPCs on the map, I suggest name the NPCs like this: NPCNAME#mapname
BattleNPC#poring_w01
testnpc#poring_w01
BattleNPC#anothermap
testnpc#anothermap
Then if you want BattleNPC#poring_w01 to trigger something in testnpc#poring_w01 you could do:
donpcevent "testnpc#" + strnpcinfo(4);which will be "testnpc#poring_w01" because strnpcinfo(4) returns the name of the map the NPC is in.
When you create duplicates on different maps, strnpcinfo(4) will return the mapname and it will work (as long as your npcs are named NPCNAME#mapname.