+ rep for whoever can help me with this. 
I'm trying to get Frost Strike to not cast if Killing Machine is up and if Obliterate will be up in < 1s (death, frost or unholy rune) but I'm not sure if I have done this right. It doesn't seem to want to work. I'm still new to writing profiles 
PHP Code:
local KM = UnitBuffID("player",51128)
local RuneCheck = RuneCheck
if KM ~= nil then
if select(1,RuneCheck()) < 1 then
if select(3,RuneCheck()) < 1 then
if select(2,RuneCheck()) < 1 then
return false
else
if UnitPower("player") > 20 then
CastSpellByName(GetSpellInfo(49143),nil)
return true
end
end
end
end