```
for i = 1, 40 do -- 循环遍历1-40号Debuff
local name, _, _, _, _, _, _, _, _, spellId = UnitDebuff("target", i)
if not name then -- 如果没有Debuff了,跳出循环
break
end
if spellId == YOUR_DEBUFF_SPELL_ID then -- 如果该Debuff是你要查询的Debuff,做对应的处理(比如记录Debuff剩余时间等)
-- do something
end
end
```