Well if the this.name isn't that same on the clientside you could store their .name in an attr and do..
PHP Code:
function onCreated() {
attr[3] = this.name;
}
//#CLIENTSIDE
function onDamageNPC(baddy) {
triggerserver("npc", baddy.attr[3], "damage", 9999);
}
Of course you'll need some sort of targetting system to use the damage npc function.