COMBAT_LOG_EVENT_UNFILTERED
function(...)
    local spellName = select(14, ...)
    local target = select(10, ...)
    local source = select(6, ...)
    local subEvent = select(3, ...)
    if (spellName == "Tricks of the Trade" or spellName == "Misdirection") and subEvent == "SPELL_CAST_SUCCESS" then
        aura_env.spellName = spellName
        aura_env.caster = source
        aura_env.target = target
        aura_env.cast_time = GetTime()
        return true
    else
        return false
    end
end

DISPLAY
function()
    local target_class = UnitClass(aura_env.target)
    local target_class_color = "|cFFFFFFFF"
    local time_color = "|cFFFFFFFF"
    if aura_env.spellName == "Tricks of the Trade" then local cooldown_time = aura_env.cast_time + 30 elseif aura_env.spellName == "Misdirection" then cooldown_time = aura_env.cast_time + 30 end
    if (cooldown_time / GetTime()) < 1 then time_color = "|cFF00FF00" else time_color = "|cFFFF0000" end
    if UnitClass(aura_env.target) == "Death Knight" then target_class_color = "|cFFC41F3B"
    elseif UnitClass(aura_env.target) == "Demon Hunter" then target_class_color = "|cFFA330C9"
    elseif UnitClass(aura_env.target) == "Druid" then target_class_color = "|cFFFF7D0A"
    elseif UnitClass(aura_env.target) == "Hunter" then target_class_color = "|cFFABD473"
    elseif UnitClass(aura_env.target) == "Mage" then target_class_color = "|cFF40C7EB"
    elseif UnitClass(aura_env.target) == "Monk" then target_class_color = "|cFF00FF96"
    elseif UnitClass(aura_env.target) == "Paladin" then target_class_color = "|cFFF58CBA"
    elseif UnitClass(aura_env.target) == "Priest" then target_class_color = "|cFFFFFFFF"
    elseif UnitClass(aura_env.target) == "Rogue" then target_class_color = "|cFFFFF569"
    elseif UnitClass(aura_env.target) == "Shaman" then target_class_color = "|cFF0070DE"
    elseif UnitClass(aura_env.target) == "Warlock" then target_class_color = "|cFF8787ED"
    elseif UnitClass(aura_env.target) == "Warrior" then target_class_color = "|cFFC79C6E" end
    local source_class = UnitClass(aura_env.caster)
    if source_class == "Hunter" then return  "|cFF0000FF------------------------------- \n" .. "|cFFABD473" .. aura_env.caster .. target_class_color .. "\n" ..  aura_env.target .. "\n" .. "|cFFABD473" .. aura_env.spellName .. "\n" .. time_color .. math.floor(GetTime() - aura_env.cast_time) .. "\n|cFF0000FF-------------------------------"
    elseif
    source_class == "Rogue" then return "|cFF0000FF------------------------------- \n" .. "|cFFFFF569"  .. aura_env.caster .. "\n" .. target_class_color ..  aura_env.target .. "\n" .. "|cFFFFF569" .. aura_env.spellName .. "\n" .. time_color .. math.floor(GetTime() - aura_env.cast_time) .. "\n|cFF0000FF-------------------------------"
    end
end

INIT
aura_env.target = ""
aura_env.cast_time = 0
aura_env.spellName = ""
aura_env.caster = ""
