Well, that function is in KotOR 1, I'm not sure why it isn't compiling, when i tried it without the fixed nwscript it didn't work but with the fixed nwscript it compiled, if you download the fixed nwscript here (
http://www.masterzionosiskotorsite.com/Mods/nwscript.nss), it should then compile without errors.
The EffectDeath() function exist in KOTOR 1, but it has one less parameter than in TSL. In TSL the third parameter can be set to prevent the victim's corpse to fade away like it usually does after a few seconds after someone is killed. In KOTOR 1 you'll have to set that separately. Like:
void main() {
effect eVisual = EffectVisualEffect( VFX_FNF_GRENADE_THERMAL_DETONATOR );
effect eKill = EffectDeath();
SetIsDestroyable(FALSE);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVisual, GetLocation(OBJECT_SELF));
DelayCommand(0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eKill, OBJECT_SELF));
}
If you try to compile a script using three parameters to EffectDeath() for KOTOR 1 it will fail since it won't match the function signature in that version of NWScript.