Delete the file ViperWarn.xml, open the ViperWarn.toc file and change 'ViperWarn.xml' to 'ViperWarn.lua', then change the full contents of the ViperWarn.lua file to:
local has = false
local e = CreateFrame('Frame')
if GetPlayerDebuffName('Viper Sting') then
if not has then
has = true
ZoneTextFrame.startTime = GetTime()
ZoneTextFrame.fadeInTime = 0
ZoneTextFrame.holdTime = 2
ZoneTextFrame.fadeOutTime = 3
has = false
(Note: you can open all the files in Windows Notepad.)
The global function he used GetPlayerDebuffName("Spell Name") is not actually blizzard function, it's probably from a library or framework I think.
You would have to iterate through the players debuffs and use UnitDebuff, which doesn't sound very efficient.
Alternatively you could register for COMBAT_LOG_EVENT_UNFILTERED and work out which sub event is triggered by viper sting. Probably SPELL_PERIODIC_AURA_APPLIED_DOSE (guessing) but I would need a hunter to test with to identify it.