local Observable = importWM('RxW3', 'Observable');
local filter = importWM('RxW3', 'Operators/Filter');
local EVENT_TYPE_ANY_UNIT = importWM('RxW3', 'Events/AnyUnit');
Observable.fromEvent(EVENT_TYPE_ANY_UNIT, EVENT_PLAYER_UNIT_SPELL_EFFECT):pipe(
filter(function (args) return args[1] == FourCC('AUan') end), --Filter for the animate dead ability (event args used to get spell ability id instead)
):subscribe(function (args) KillUnit(args[0]) end); --Kill the triggering unit (casting unit) to show it worked (event args used to get caster instead)