then, just use a timer.
This would be like:
1. Create a function in your map header:
function DestroyGivenAbility takes nothing returns nothing
local timer temp = GetExpiredTimer()
local unit u = LoadUnitHandle( udg_Cache, GetHandleId(temp), 0)
call UnitRemoveAbility(u, 'YOURABILITYINTEGER')
call DestroyTimer(temp)
set u = null
set temp=null
endfunction
2. Create a HashCache in variables and create a hashcache at map init and save it to the variable hashcache.
3. Custom script: local timer temptimer
4. Add the ability to your unit of choice.
5. Custom script: call TimerStart( temptimer, x seconds, false, function DestroyGivenAbility)
6. Custom script: call SaveUnitHandle( udg_Cache, GetHandleId(temptimer), 0, YOURUNITOFCHOICE)
7. Custom script: set temptimer = null
This is not in functional form, but it is basicly the script u need for this without using waits. It uses a HashCache, just look for a tutorial to learn how to init it at map init!