// Where are commas between function arguments?
function SE takes string SpecialEffect, location Loc, real Duration returns nothing
// that is just bad coding style, because:
// 1. It uses BJ functions
// 2. It does not set local variable at init
// (your variant would also work, but it's lame, seriously)
//local effect Effect
//call AddSpecialEffectLocBJ(Loc,SpecialEffect)
//set Effect=GetLastCreatedEffectBJ()
// the right way to go is:
local effect Effect = AddSpecialEffectLoc(SpecialEffect, Loc)
// function call needs "call" keyword before function name
// also, I don't recommend to use PolledWait and TriggerSleepAction,
// since they are can cause bugs and are not precise (at least).
// Use timers instead.
call PolledWait(Duration)
call DestroyEffect(Effect)
call RemoveLocation(Loc)
// nullifying Effect variable to prevent "leaks"
set Effect = null
endfunction