you can try this. its what i use to toggle haste sets -- use spell id's not buff id's
function m_action(action)
for index,target in pairs(action['targets']) do
if (action['targets'] ~= nil) then
for target_index,target in pairs(action['targets']) do
for action_index,action in pairs(target['actions']) do
if (action['message'] == 75) then
return;
end
end
end
end
if (target['id'] == player['id']) then
-- spells that are applied to you --
if (action['category'] == 4) then
if (action['param'] == 57) then -- Haste
count = 1;
elseif (action['param'] == 511) then -- Haste II
count = 2;
elseif (action['param'] == 358) then -- Haste II
count = 2;
end
end -- make embrava turn Haste to 1
end
end
end
windower.register_event('action', m_action);