This one actually works for player, party, etc.
Code:
oUF.Tags["threatpercent"] = function(unit)
local _,_,threatpct,_ ,_ = UnitDetailedThreatSituation(unit, "target")
if threatpct and UnitExists("target") then
return floor(threatpct + 0.5)
else
return
end
end
oUF.TagEvents["threatpercent"] = "UNIT_THREAT_SITUATION_UPDATE UNIT_THREAT_LIST_UPDATE PLAYER_TARGET_CHANGED"
Not sure how to make it update more frequently, though. Maybe a tag just isn't the right thing for this after all.