local _,cost,start, duration

WhatsNext:AddConditionalStatement("Minimum Cost",{
	category = "Ability",
	test = function(checkTable) 
		_, _, _, cost, _, _, _, _, _ = GetSpellInfo(checkTable.spellName)
		return cost >= tonumber(checkTable.amount)
	end,
	text = function(checkTable) 
		return WN_GetSpellName(checkTable.spellName) .. " costs at least " .. tostring(checkTable.amount) .. " power."
	end,
	arguments = {
		amount = {type = "integer", default = 0},
		spellName = {type = "spell", default = ""}
	}
})

WhatsNext:AddConditionalStatement("Maximum Cost",{
	category = "Ability",
	test = function(checkTable) 
		_, _, _, cost, _, _, _, _, _ = GetSpellInfo(checkTable.spellName)
		return cost <= tonumber(checkTable.amount)
	end,
	text = function(checkTable) 
		return WN_GetSpellName(checkTable.spellName) .. " costs no more than " .. tostring(checkTable.amount) .. " power."
	end,
	arguments = {
		amount = {type = "integer", default = 0},
		spellName = {type = "spell", default = ""}
	}
})

WhatsNext:AddConditionalStatement("Ability Cooldown",{
	category = "Ability",
	test = function(checkTable)
		start, duration = GetSpellCooldown(WN_GetSpellName(checkTable.spellName))
		return start and start > 0 and start + duration - GetTime() > tonumber(checkTable.time)
	end,
	text = function(checkTable)
		return WN_GetSpellName(checkTable.spellName) .. " will be on cooldown for more than " .. tostring(checkTable.time) .. " second(s)."
	end,
	arguments = {
		spellName = {type = "spell", default = ""},
		time = {type = "integer", default = 3}
	}
})
WhatsNext:AddConditionalStatement("Ability Usable",{
	category = "Ability",
	test = function(checkTable)
		return IsUsableSpell(WN_GetSpellName(checkTable.spellName))
	end,
	text = function(checkTable)
		return WN_GetSpellName(checkTable.spellName) .. " can be cast if off cooldown."
	end,
	arguments = {
		spellName = {type = "spell", default = ""},
	}
})