"While" isn't a valid script command in FO scripting is it? I don't recall ever seeing it used. Try using "If (Timer <= 20)"
Same here.
But if you use the first 'if' then the next will be 'elseif'. Or you could try just closing each one off like I would.
Not to mention you need an end at the end. I have never seen brackets used either.
Try this:
If timer <= 20; same thing, but run it on a scripteffectupdate block or gamemode
set timer to timer + GetSecondsPassed
endif; closing it off
If timer >= 20; Greater than just for the heck of it.
player.removespell AAADocZCustomPerk
endif; closing it off
end; ending the block
Also, you could just do:
Begin ScriptEffectStart
player.addspell AAADocZCustomPerk; Set the effect for 20 seconds
end