NAME_PLATE_UNIT_ADDED fires with a UnitID for what the nameplate is attached to. You can add a check on that by adding the highlighted lines to this code block.
Code:
if event == "NAME_PLATE_UNIT_ADDED" then
local np = select(1, ...)
if UnitIsEnemy("player", np) then
return aura_env.track_plate(allstates, np)
end
end
Note: The
return is safe to skip as the code exits soon after anyway when it checks if it's a CLEU event.