local _,cost,start, duration

WhatsNext:AddConditionalStatement("Minimum Cost",{
	category = "Ability",
	test = function(checkTable) 
		return WhatsNext_GetSpellCost(checkTable.spellName) >= 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) 
		return WhatsNext_GetSpellCost(checkTable.spellName) <= 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 = ""},
	}
})
WhatsNext:AddConditionalStatement("Ability Charge Count",{
	category = "Ability",
	test = function(checkTable)
		local chargeCount,maxCharges, cooldownStart, cooldownDuration = GetSpellCharges(WN_GetSpellName(checkTable.spellName));
		return chargeCount >= tonumber(checkTable.chargeCount)
	end,
	text = function(checkTable)
		return WN_GetSpellName(checkTable.spellName) .. " has at least " .. checkTable.chargeCount .. " charge(s)."
	end,
	arguments = {
		spellName = {type = "spell", default = ""},
		chargeCount = {type = "integer", default = 1}
	}
})