Thanks for your help, I thought I'd post the scripts. I need to test them further, but I'm pretty sure they work well enough.
First I created an invisible object with the tag: q6e_ShaorisFellTemple ... Then, this is placed in OnPlayerRespawn module event:
//added 5/31/16, fires the level drain respawn penalty
//uses a special tag the makes the level drain semi-permanent/unremovable
object oLvlDrainer = GetObjectByTag("q6e_ShaorisFellTemple");
ExecuteScript("rui_leveldrain", oLvlDrainer);
rui_leveldrain.nss which applies the penalty and executes the timer loop:
#include "NW_I0_GENERIC"
#include "nw_i0_spells"
// 6/1/16 applies respawn penalty
void main()
{
object oTarget = GetLastRespawnButtonPresser();
int iLevel = GetCharacterLevel(oTarget);
int iHalfLvl = iLevel / 2;
effect eDrain = SupernaturalEffect(EffectNegativeLevel(iHalfLvl));
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDrain, oTarget);
SendMessageToPC(oTarget, "Level drain applied as a respawn penalty, lasting 3 minutes.");
ExecuteScript("rui_leveldloop", oTarget);
}
This makes sure the level drain is removed after re-logging + added the timer (rui_leveldloop.nss):
#include "nw_i0_spells"
// 6/1/16 removes respawn penalty, and creates a continuous loop to detect player and remove penalty if player logs off and rejoins
// when a player logs on when the penalty is still active, their timer restarts with 3 minutes remaining
// my thread: http://forum.bioware.com/topic/572976-semi-permanent-level-drain/
void main()
{
object oPC = OBJECT_SELF;
if(!GetIsObjectValid(oPC))
{
DelayCommand(20.0, ExecuteScript("rui_leveldloop", oPC));
}
else
{
DelayCommand(180.0, RemoveSpecificEffect(EFFECT_TYPE_NEGATIVELEVEL, oPC));
DelayCommand(180.0, SendMessageToPC(oPC, "Your respawn penalty is longer in effect."));
}
}