Script for Counting Nameplates

Does anyone know what the correct/updated version of this might be? Before prepatch, I used it for any achievements or kills that required tracking the number of mobs (like Stay Salty, or tracking Corrupted Blood for Spine of Deathwing):

/run local t,c=“Corrupted Blood”,0 for i=1,10000 do local p=C_NamePlate.GetNamePlateForUnit(“nameplate”…i) if p and p:IsVisible() and p:GetChildren():GetRegions():GetText()==t then c=c+1 end end print(t,":",c)