Quantcast

Update default scripts to latest SimulationCraft reference scripts.

Johnny C. Lam [12-28-14 - 04:10]
Update default scripts to latest SimulationCraft reference scripts.

The default scripts are now mostly machine-translated from the
SimulationCraft profiles with some manual fixes and tweaks and should be
much simpler to maintain over time.
Filename
scripts/ovale_deathknight.lua
scripts/ovale_druid.lua
scripts/ovale_hunter.lua
scripts/ovale_mage.lua
scripts/ovale_monk.lua
scripts/ovale_paladin.lua
scripts/ovale_priest.lua
scripts/ovale_rogue.lua
scripts/ovale_shaman.lua
scripts/ovale_warlock.lua
scripts/ovale_warrior.lua
diff --git a/scripts/ovale_deathknight.lua b/scripts/ovale_deathknight.lua
index a2d4a1c..0d3f916 100644
--- a/scripts/ovale_deathknight.lua
+++ b/scripts/ovale_deathknight.lua
@@ -269,28 +269,28 @@ AddFunction BloodReActions
 #	spec=frost
 #	talents=2001002

-# ActionList: FrostDualWieldDefaultActions --> main, shortcd, cd
+### actions.default --> main, shortcd, cd

-AddFunction FrostDualWieldDefaultActions
+AddFunction FrostDualWieldDefaultMainActions
 {
-	#auto_attack
-	#call_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 FrostDualWieldAoeActions()
-	#call_action_list,name=single_target,if=active_enemies<3
-	if Enemies() < 3 FrostDualWieldSingleTargetActions()
+	#run_action_list,name=aoe,if=active_enemies>=3
+	if Enemies() >= 3 FrostDualWieldAoeMainActions()
+	#run_action_list,name=single_target,if=active_enemies<3
+	if Enemies() < 3 FrostDualWieldSingleTargetMainActions()
 }

 AddFunction FrostDualWieldDefaultShortCdActions
 {
+	#auto_attack
 	#deaths_advance,if=movement.remains>2
 	if 0 > 2 Spell(deaths_advance)
 	#antimagic_shell,damage=100000
 	if IncomingDamage(1.5) > 0 Spell(antimagic_shell)
 	#pillar_of_frost
 	Spell(pillar_of_frost)
-	#call_action_list,name=aoe,if=active_enemies>=3
+	#run_action_list,name=aoe,if=active_enemies>=3
 	if Enemies() >= 3 FrostDualWieldAoeShortCdActions()
-	#call_action_list,name=single_target,if=active_enemies<3
+	#run_action_list,name=single_target,if=active_enemies<3
 	if Enemies() < 3 FrostDualWieldSingleTargetShortCdActions()
 }

@@ -314,22 +314,18 @@ AddFunction FrostDualWieldDefaultCdActions
 	if Enemies() < 3 FrostDualWieldSingleTargetCdActions()
 }

-# ActionList: FrostDualWieldAoeActions --> main, shortcd, cd
+### actions.aoe --> main, shortcd, cd

-AddFunction FrostDualWieldAoeActions
+AddFunction FrostDualWieldAoeMainActions
 {
 	#blood_boil,if=dot.blood_plague.ticking&(!talent.unholy_blight.enabled|cooldown.unholy_blight.remains<49),line_cd=28
 	if target.DebuffPresent(blood_plague_debuff) and { not Talent(unholy_blight_talent) or SpellCooldown(unholy_blight) < 49 } and TimeSincePreviousSpell(blood_boil) > 28 Spell(blood_boil)
-	#defile
-	Spell(defile)
 	#run_action_list,name=bos_aoe,if=dot.breath_of_sindragosa.ticking
-	if target.DebuffPresent(breath_of_sindragosa_debuff) FrostDualWieldBosAoeActions()
+	if BuffPresent(breath_of_sindragosa_buff) FrostDualWieldBosAoeMainActions()
 	#howling_blast
 	Spell(howling_blast)
 	#frost_strike,if=runic_power>88
 	if RunicPower() > 88 Spell(frost_strike)
-	#death_and_decay,if=unholy=1
-	if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(death_and_decay)
 	#plague_strike,if=unholy=2
 	if Rune(unholy) >= 2 Spell(plague_strike)
 	#frost_strike,if=!talent.breath_of_sindragosa.enabled|cooldown.breath_of_sindragosa.remains>=10
@@ -346,10 +342,11 @@ AddFunction FrostDualWieldAoeShortCdActions
 	Spell(unholy_blight)

 	unless target.DebuffPresent(blood_plague_debuff) and { not Talent(unholy_blight_talent) or SpellCooldown(unholy_blight) < 49 } and TimeSincePreviousSpell(blood_boil) > 28 and Spell(blood_boil)
-		or Spell(defile)
 	{
+		#defile
+		Spell(defile)
 		#run_action_list,name=bos_aoe,if=dot.breath_of_sindragosa.ticking
-		if target.DebuffPresent(breath_of_sindragosa_debuff) FrostDualWieldBosAoeShortCdActions()
+		if BuffPresent(breath_of_sindragosa_buff) FrostDualWieldBosAoeShortCdActions()

 		unless Spell(howling_blast)
 		{
@@ -357,11 +354,15 @@ AddFunction FrostDualWieldAoeShortCdActions
 			if BuffStacks(blood_charge_buff) > 10 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)

 			unless RunicPower() > 88 and Spell(frost_strike)
-				or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(death_and_decay)
-				or Rune(unholy) >= 2 and Spell(plague_strike)
 			{
-				#blood_tap
-				if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+				#death_and_decay,if=unholy=1
+				if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(death_and_decay)
+
+				unless Rune(unholy) >= 2 and Spell(plague_strike)
+				{
+					#blood_tap
+					if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+				}
 			}
 		}
 	}
@@ -369,22 +370,14 @@ AddFunction FrostDualWieldAoeShortCdActions

 AddFunction FrostDualWieldAoeCdActions
 {
-	unless Spell(unholy_blight)
-		or target.DebuffPresent(blood_plague_debuff) and { not Talent(unholy_blight_talent) or SpellCooldown(unholy_blight) < 49 } and TimeSincePreviousSpell(blood_boil) > 28 and Spell(blood_boil)
-		or Spell(defile)
+	unless Spell(unholy_blight) or target.DebuffPresent(blood_plague_debuff) and { not Talent(unholy_blight_talent) or SpellCooldown(unholy_blight) < 49 } and TimeSincePreviousSpell(blood_boil) > 28 and Spell(blood_boil) or Spell(defile)
 	{
 		#breath_of_sindragosa,if=runic_power>75
 		if RunicPower() > 75 Spell(breath_of_sindragosa)
 		#run_action_list,name=bos_aoe,if=dot.breath_of_sindragosa.ticking
 		if BuffPresent(breath_of_sindragosa_buff) FrostDualWieldBosAoeCdActions()

-		unless Spell(howling_blast)
-			or RunicPower() > 88 and Spell(frost_strike)
-			or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(death_and_decay)
-			or Rune(unholy) >= 2 and Spell(plague_strike)
-			or { not Talent(breath_of_sindragosa_talent) or SpellCooldown(breath_of_sindragosa) >= 10 } and Spell(frost_strike)
-			or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-			or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(plague_strike)
+		unless Spell(howling_blast) or RunicPower() > 88 and Spell(frost_strike) or Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(death_and_decay) or Rune(unholy) >= 2 and Spell(plague_strike) or { not Talent(breath_of_sindragosa_talent) or SpellCooldown(breath_of_sindragosa) >= 10 } and Spell(frost_strike) or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(plague_strike)
 		{
 			#empower_rune_weapon
 			Spell(empower_rune_weapon)
@@ -392,14 +385,12 @@ AddFunction FrostDualWieldAoeCdActions
 	}
 }

-# ActionList: FrostDualWieldBosAoeActions --> main, shortcd, cd
+### actions.bos_aoe --> main, shortcd, cd

-AddFunction FrostDualWieldBosAoeActions
+AddFunction FrostDualWieldBosAoeMainActions
 {
 	#howling_blast
 	Spell(howling_blast)
-	#death_and_decay,if=unholy=1
-	if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(death_and_decay)
 	#plague_strike,if=unholy=2
 	if Rune(unholy) >= 2 Spell(plague_strike)
 	#plague_leech
@@ -414,9 +405,10 @@ AddFunction FrostDualWieldBosAoeShortCdActions
 	{
 		#blood_tap,if=buff.blood_charge.stack>10
 		if BuffStacks(blood_charge_buff) > 10 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+		#death_and_decay,if=unholy=1
+		if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(death_and_decay)

-		unless Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(death_and_decay)
-			or Rune(unholy) >= 2 and Spell(plague_strike)
+		unless Rune(unholy) >= 2 and Spell(plague_strike)
 		{
 			#blood_tap
 			if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
@@ -426,20 +418,16 @@ AddFunction FrostDualWieldBosAoeShortCdActions

 AddFunction FrostDualWieldBosAoeCdActions
 {
-	unless Spell(howling_blast)
-		or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(death_and_decay)
-		or Rune(unholy) >= 2 and Spell(plague_strike)
-		or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-		or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(plague_strike)
+	unless Spell(howling_blast) or Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(death_and_decay) or Rune(unholy) >= 2 and Spell(plague_strike) or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(plague_strike)
 	{
 		#empower_rune_weapon
 		Spell(empower_rune_weapon)
 	}
 }

-# ActionList: FrostDualWieldBosStActions --> main, shortcd, cd
+### actions.bos_st --> main, shortcd, cd

-AddFunction FrostDualWieldBosStActions
+AddFunction FrostDualWieldBosStMainActions
 {
 	#obliterate,if=buff.killing_machine.react
 	if BuffPresent(killing_machine_buff) Spell(obliterate)
@@ -450,7 +438,7 @@ AddFunction FrostDualWieldBosStActions
 	#obliterate,if=unholy>0&runic_power<76
 	if Rune(unholy) >= 1 and RunicPower() < 76 Spell(obliterate)
 	#plague_leech
-	if target.DiseasesTicking() Spell(plague_leech)
+	if target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
 }

 AddFunction FrostDualWieldBosStShortCdActions
@@ -460,9 +448,7 @@ AddFunction FrostDualWieldBosStShortCdActions
 		#blood_tap,if=buff.killing_machine.react&buff.blood_charge.stack>=5
 		if BuffPresent(killing_machine_buff) and BuffStacks(blood_charge_buff) >= 5 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)

-		unless BuffPresent(killing_machine_buff) and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-			or RunicPower() < 88 Spell(howling_blast)
-			or Rune(unholy) >= 1 and RunicPower() < 76 Spell(obliterate)
+		unless BuffPresent(killing_machine_buff) and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or RunicPower() < 88 and Spell(howling_blast) or Rune(unholy) >= 1 and RunicPower() < 76 and Spell(obliterate)
 		{
 			#blood_tap,if=buff.blood_charge.stack>=5
 			if BuffStacks(blood_charge_buff) >= 5 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
@@ -472,20 +458,16 @@ AddFunction FrostDualWieldBosStShortCdActions

 AddFunction FrostDualWieldBosStCdActions
 {
-	unless BuffPresent(killing_machine_buff) and Spell(obliterate)
-		or BuffPresent(killing_machine_buff) and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-		or RunicPower() < 88 and Spell(howling_blast)
-		or Rune(unholy) >= 1 and RunicPower() < 76 and Spell(obliterate)
-		or target.DiseasesTicking() Spell(plague_leech)
+	unless BuffPresent(killing_machine_buff) and Spell(obliterate) or BuffPresent(killing_machine_buff) and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or RunicPower() < 88 and Spell(howling_blast) or Rune(unholy) >= 1 and RunicPower() < 76 and Spell(obliterate) or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
 	{
 		#empower_rune_weapon
 		Spell(empower_rune_weapon)
 	}
 }

-# ActionList: FrostDualWieldPrecombatActions --> main, shortcd, cd
+### actions.precombat --> main, shortcd, cd

-AddFunction FrostDualWieldPrecombatActions
+AddFunction FrostDualWieldPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=sleeper_surprise
@@ -493,13 +475,11 @@ AddFunction FrostDualWieldPrecombatActions
 	if BuffExpires(attack_power_multiplier_buff any=1) Spell(horn_of_winter)
 	#frost_presence
 	Spell(frost_presence)
-	#snapshot_stats
 }

 AddFunction FrostDualWieldPrecombatShortCdActions
 {
-	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter)
-		or Spell(frost_presence)
+	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter) or Spell(frost_presence)
 	{
 		#pillar_of_frost
 		Spell(pillar_of_frost)
@@ -508,9 +488,9 @@ AddFunction FrostDualWieldPrecombatShortCdActions

 AddFunction FrostDualWieldPrecombatCdActions
 {
-	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter)
-		or Spell(frost_presence)
+	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter) or Spell(frost_presence)
 	{
+		#snapshot_stats
 		#army_of_the_dead
 		Spell(army_of_the_dead)
 		#potion,name=draenic_strength
@@ -518,16 +498,14 @@ AddFunction FrostDualWieldPrecombatCdActions
 	}
 }

-# ActionList: FrostDualWieldSingleTargetActions --> main, shortcd, cd
+### actions.single_target --> main, shortcd, cd

-AddFunction FrostDualWieldSingleTargetActions
+AddFunction FrostDualWieldSingleTargetMainActions
 {
 	#soul_reaper,if=target.health.pct-3*(target.health.pct%target.time_to_die)<=35
 	if target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 Spell(soul_reaper_frost)
 	#run_action_list,name=bos_st,if=dot.breath_of_sindragosa.ticking
-	if BuffPresent(breath_of_sindragosa_buff) FrostDualWieldBosStActions()
-	#defile
-	Spell(defile)
+	if BuffPresent(breath_of_sindragosa_buff) FrostDualWieldBosStMainActions()
 	#howling_blast,if=talent.breath_of_sindragosa.enabled&cooldown.breath_of_sindragosa.remains<7&runic_power<88
 	if Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 Spell(howling_blast)
 	#obliterate,if=talent.breath_of_sindragosa.enabled&cooldown.breath_of_sindragosa.remains<3&runic_power<76
@@ -548,8 +526,8 @@ AddFunction FrostDualWieldSingleTargetActions
 	if BuffPresent(rime_buff) Spell(howling_blast)
 	#frost_strike,if=set_bonus.tier17_2pc=1&(runic_power>=50&(cooldown.pillar_of_frost.remains<5))
 	if ArmorSetBonus(T17 2) == 1 and RunicPower() >= 50 and SpellCooldown(pillar_of_frost) < 5 Spell(frost_strike)
-	#frost_strike,if=runic_power>=76
-	if RunicPower() >= 76 Spell(frost_strike)
+	#frost_strike,if=runic_power>76
+	if RunicPower() > 76 Spell(frost_strike)
 	#obliterate,if=unholy>0&!buff.killing_machine.react
 	if Rune(unholy) >= 1 and not BuffPresent(killing_machine_buff) Spell(obliterate)
 	#howling_blast,if=!(target.health.pct-3*(target.health.pct%target.time_to_die)<=35&cooldown.soul_reaper.remains<3)|death+frost>=2
@@ -569,33 +547,20 @@ AddFunction FrostDualWieldSingleTargetShortCdActions
 		if target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and not SpellCooldown(soul_reaper_frost) > 0 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 		#run_action_list,name=bos_st,if=dot.breath_of_sindragosa.ticking
 		if BuffPresent(breath_of_sindragosa_buff) FrostDualWieldBosStShortCdActions()
+		#defile
+		Spell(defile)
+		#blood_tap,if=talent.defile.enabled&cooldown.defile.remains=0
+		if Talent(defile_talent) and not SpellCooldown(defile) > 0 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)

-		unless Spell(defile)
+		unless Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Spell(howling_blast) or Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 3 and RunicPower() < 76 and Spell(obliterate) or { BuffPresent(killing_machine_buff) or RunicPower() > 88 } and Spell(frost_strike) or SpellCooldown(antimagic_shell) < 1 and RunicPower() >= 50 and not BuffPresent(antimagic_shell_buff) and Spell(frost_strike) or { Rune(death) >= 2 or Rune(frost) >= 2 } and Spell(howling_blast)
 		{
-			#blood_tap,if=talent.defile.enabled&cooldown.defile.remains=0
-			if Talent(defile_talent) and not SpellCooldown(defile) > 0 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-
-			unless Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Spell(howling_blast)
-				or Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 3 and RunicPower() < 76 and Spell(obliterate)
-				or { BuffPresent(killing_machine_buff) or RunicPower() > 88 } and Spell(frost_strike)
-				or SpellCooldown(antimagic_shell) < 1 and RunicPower() >= 50 and not BuffPresent(antimagic_shell_buff) and Spell(frost_strike)
-				or { Rune(death) >= 2 or Rune(frost) >= 2 } and Spell(howling_blast)
+			#unholy_blight,if=!disease.ticking
+			if not target.DiseasesAnyTicking() Spell(unholy_blight)
+
+			unless not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and Spell(howling_blast) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(howling_blast) or not Talent(necrotic_plague_talent) and not target.DebuffPresent(blood_plague_debuff) and Rune(unholy) >= 1 and Spell(plague_strike) or BuffPresent(rime_buff) and Spell(howling_blast) or ArmorSetBonus(T17 2) == 1 and RunicPower() >= 50 and SpellCooldown(pillar_of_frost) < 5 and Spell(frost_strike) or RunicPower() > 76 and Spell(frost_strike) or Rune(unholy) >= 1 and not BuffPresent(killing_machine_buff) and Spell(obliterate) or { not { target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and SpellCooldown(soul_reaper_frost) < 3 } or RuneCount(death) + RuneCount(frost) >= 2 } and Spell(howling_blast)
 			{
-				#unholy_blight,if=!disease.ticking
-				if not target.DiseasesAnyTicking() Spell(unholy_blight)
-
-				unless not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and Spell(howling_blast)
-					or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(howling_blast)
-					or not Talent(necrotic_plague_talent) and not target.DebuffPresent(blood_plague_debuff) and Rune(unholy) >= 1 and Spell(plague_strike)
-					or BuffPresent(rime_buff) and Spell(howling_blast)
-					or ArmorSetBonus(T17 2) == 1 and RunicPower() >= 50 and SpellCooldown(pillar_of_frost) < 5 and Spell(frost_strike)
-					or RunicPower() >= 76 and Spell(frost_strike)
-					or Rune(unholy) >= 1 and not BuffPresent(killing_machine_buff) and Spell(obliterate)
-					or { not { target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and SpellCooldown(soul_reaper_frost) < 3 } or RuneCount(death) + RuneCount(frost) >= 2 } and Spell(howling_blast)
-				{
-					#blood_tap
-					if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-				}
+				#blood_tap
+				if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 			}
 		}
 	}
@@ -610,22 +575,7 @@ AddFunction FrostDualWieldSingleTargetCdActions
 		#run_action_list,name=bos_st,if=dot.breath_of_sindragosa.ticking
 		if BuffPresent(breath_of_sindragosa_buff) FrostDualWieldBosStCdActions()

-		unless Spell(defile)
-			or Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Spell(howling_blast)
-			or Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 3 and RunicPower() < 76 and Spell(obliterate)
-			or { BuffPresent(killing_machine_buff) or RunicPower() > 88 } and Spell(frost_strike)
-			or SpellCooldown(antimagic_shell) < 1 and RunicPower() >= 50 and not BuffPresent(antimagic_shell_buff) and Spell(frost_strike)
-			or { Rune(death) >= 2 or Rune(frost) >= 2 } and Spell(howling_blast)
-			or not target.DiseasesAnyTicking() and Spell(unholy_blight)
-			or not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and Spell(howling_blast)
-			or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(howling_blast)
-			or not Talent(necrotic_plague_talent) and not target.DebuffPresent(blood_plague_debuff) and Rune(unholy) >= 1 and Spell(plague_strike)
-			or BuffPresent(rime_buff) and Spell(howling_blast)
-			or ArmorSetBonus(T17 2) == 1 and RunicPower() >= 50 and SpellCooldown(pillar_of_frost) < 5 and Spell(frost_strike)
-			or RunicPower() >= 76 and Spell(frost_strike)
-			or Rune(unholy) >= 1 and not BuffPresent(killing_machine_buff) and Spell(obliterate)
-			or { not { target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and SpellCooldown(soul_reaper_frost) < 3 } or RuneCount(death) + RuneCount(frost) >= 2 } and Spell(howling_blast)
-			or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
+		unless Spell(defile) or Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Spell(howling_blast) or Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 3 and RunicPower() < 76 and Spell(obliterate) or { BuffPresent(killing_machine_buff) or RunicPower() > 88 } and Spell(frost_strike) or SpellCooldown(antimagic_shell) < 1 and RunicPower() >= 50 and not BuffPresent(antimagic_shell_buff) and Spell(frost_strike) or { Rune(death) >= 2 or Rune(frost) >= 2 } and Spell(howling_blast) or not target.DiseasesAnyTicking() and Spell(unholy_blight) or not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and Spell(howling_blast) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(howling_blast) or not Talent(necrotic_plague_talent) and not target.DebuffPresent(blood_plague_debuff) and Rune(unholy) >= 1 and Spell(plague_strike) or BuffPresent(rime_buff) and Spell(howling_blast) or ArmorSetBonus(T17 2) == 1 and RunicPower() >= 50 and SpellCooldown(pillar_of_frost) < 5 and Spell(frost_strike) or RunicPower() > 76 and Spell(frost_strike) or Rune(unholy) >= 1 and not BuffPresent(killing_machine_buff) and Spell(obliterate) or { not { target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and SpellCooldown(soul_reaper_frost) < 3 } or RuneCount(death) + RuneCount(frost) >= 2 } and Spell(howling_blast) or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
 		{
 			#empower_rune_weapon
 			Spell(empower_rune_weapon)
@@ -641,19 +591,19 @@ AddFunction FrostDualWieldSingleTargetCdActions
 #	spec=frost
 #	talents=2001002

-# ActionList: FrostTwoHanderDefaultActions --> main, shortcd, cd
+### actions.default --> main, shortcd, cd

-AddFunction FrostTwoHanderDefaultActions
+AddFunction FrostTwoHanderDefaultMainActions
 {
-	#auto_attack
 	#run_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 FrostTwoHanderAoeActions()
+	if Enemies() >= 3 FrostTwoHanderAoeMainActions()
 	#run_action_list,name=single_target,if=active_enemies<3
-	if Enemies() < 3 FrostTwoHanderSingleTargetActions()
+	if Enemies() < 3 FrostTwoHanderSingleTargetMainActions()
 }

 AddFunction FrostTwoHanderDefaultShortCdActions
 {
+	#auto_attack
 	#deaths_advance,if=movement.remains>2
 	if 0 > 2 Spell(deaths_advance)
 	#antimagic_shell,damage=100000
@@ -686,22 +636,18 @@ AddFunction FrostTwoHanderDefaultCdActions
 	if Enemies() < 3 FrostTwoHanderSingleTargetCdActions()
 }

-# ActionList: FrostTwoHanderAoeActions --> main, shortcd, cd
+### actions.aoe --> main, shortcd, cd

-AddFunction FrostTwoHanderAoeActions
+AddFunction FrostTwoHanderAoeMainActions
 {
 	#blood_boil,if=dot.blood_plague.ticking&(!talent.unholy_blight.enabled|cooldown.unholy_blight.remains<49),line_cd=28
 	if target.DebuffPresent(blood_plague_debuff) and { not Talent(unholy_blight_talent) or SpellCooldown(unholy_blight) < 49 } and TimeSincePreviousSpell(blood_boil) > 28 Spell(blood_boil)
-	#defile
-	Spell(defile)
 	#run_action_list,name=bos_aoe,if=dot.breath_of_sindragosa.ticking
-	if BuffPresent(breath_of_sindragosa_buff) FrostTwoHanderBosAoeActions()
+	if BuffPresent(breath_of_sindragosa_buff) FrostTwoHanderBosAoeMainActions()
 	#howling_blast
 	Spell(howling_blast)
 	#frost_strike,if=runic_power>88
 	if RunicPower() > 88 Spell(frost_strike)
-	#death_and_decay,if=unholy=1
-	if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(death_and_decay)
 	#plague_strike,if=unholy=2
 	if Rune(unholy) >= 2 Spell(plague_strike)
 	#frost_strike,if=!talent.breath_of_sindragosa.enabled|cooldown.breath_of_sindragosa.remains>=10
@@ -718,8 +664,9 @@ AddFunction FrostTwoHanderAoeShortCdActions
 	Spell(unholy_blight)

 	unless target.DebuffPresent(blood_plague_debuff) and { not Talent(unholy_blight_talent) or SpellCooldown(unholy_blight) < 49 } and TimeSincePreviousSpell(blood_boil) > 28 and Spell(blood_boil)
-		or Spell(defile)
 	{
+		#defile
+		Spell(defile)
 		#run_action_list,name=bos_aoe,if=dot.breath_of_sindragosa.ticking
 		if BuffPresent(breath_of_sindragosa_buff) FrostTwoHanderBosAoeShortCdActions()

@@ -729,11 +676,15 @@ AddFunction FrostTwoHanderAoeShortCdActions
 			if BuffStacks(blood_charge_buff) > 10 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)

 			unless RunicPower() > 88 and Spell(frost_strike)
-				or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(death_and_decay)
-				or Rune(unholy) >= 2 and Spell(plague_strike)
 			{
-				#blood_tap
-				if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+				#death_and_decay,if=unholy=1
+				if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(death_and_decay)
+
+				unless Rune(unholy) >= 2 and Spell(plague_strike)
+				{
+					#blood_tap
+					if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+				}
 			}
 		}
 	}
@@ -741,23 +692,14 @@ AddFunction FrostTwoHanderAoeShortCdActions

 AddFunction FrostTwoHanderAoeCdActions
 {
-	unless Spell(unholy_blight)
-		or target.DebuffPresent(blood_plague_debuff) and { not Talent(unholy_blight_talent) or SpellCooldown(unholy_blight) < 49 } and TimeSincePreviousSpell(blood_boil) > 28 and Spell(blood_boil)
-		or Spell(defile)
+	unless Spell(unholy_blight) or target.DebuffPresent(blood_plague_debuff) and { not Talent(unholy_blight_talent) or SpellCooldown(unholy_blight) < 49 } and TimeSincePreviousSpell(blood_boil) > 28 and Spell(blood_boil) or Spell(defile)
 	{
 		#breath_of_sindragosa,if=runic_power>75
 		if RunicPower() > 75 Spell(breath_of_sindragosa)
 		#run_action_list,name=bos_aoe,if=dot.breath_of_sindragosa.ticking
 		if BuffPresent(breath_of_sindragosa_buff) FrostTwoHanderBosAoeCdActions()

-		unless Spell(howling_blast)
-			or BuffStacks(blood_charge_buff) > 10 and BuffStacks(blood_charge_buff) >= 5 and Spell(blood_tap)
-			or RunicPower() > 88 and Spell(frost_strike)
-			or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(death_and_decay)
-			or Rune(unholy) >= 2 and Spell(plague_strike)
-			or { not Talent(breath_of_sindragosa_talent) or SpellCooldown(breath_of_sindragosa) >= 10 } and Spell(frost_strike)
-			or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-			or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(plague_strike)
+		unless Spell(howling_blast) or RunicPower() > 88 and Spell(frost_strike) or Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(death_and_decay) or Rune(unholy) >= 2 and Spell(plague_strike) or { not Talent(breath_of_sindragosa_talent) or SpellCooldown(breath_of_sindragosa) >= 10 } and Spell(frost_strike) or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(plague_strike)
 		{
 			#empower_rune_weapon
 			Spell(empower_rune_weapon)
@@ -765,14 +707,12 @@ AddFunction FrostTwoHanderAoeCdActions
 	}
 }

-# ActionList: FrostTwoHanderBosAoeActions --> main, shortcd, cd
+### actions.bos_aoe --> main, shortcd, cd

-AddFunction FrostTwoHanderBosAoeActions
+AddFunction FrostTwoHanderBosAoeMainActions
 {
 	#howling_blast
 	Spell(howling_blast)
-	#death_and_decay,if=unholy=1
-	if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(death_and_decay)
 	#plague_strike,if=unholy=2
 	if Rune(unholy) >= 2 Spell(plague_strike)
 	#plague_leech
@@ -787,9 +727,10 @@ AddFunction FrostTwoHanderBosAoeShortCdActions
 	{
 		#blood_tap,if=buff.blood_charge.stack>10
 		if BuffStacks(blood_charge_buff) > 10 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+		#death_and_decay,if=unholy=1
+		if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(death_and_decay)

-		unless Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(death_and_decay)
-			or Rune(unholy) >= 2 and Spell(plague_strike)
+		unless Rune(unholy) >= 2 and Spell(plague_strike)
 		{
 			#blood_tap
 			if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
@@ -799,20 +740,16 @@ AddFunction FrostTwoHanderBosAoeShortCdActions

 AddFunction FrostTwoHanderBosAoeCdActions
 {
-	unless Spell(howling_blast)
-		or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(death_and_decay)
-		or Rune(unholy) >= 2 and Spell(plague_strike)
-		or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-		or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(plague_strike)
+	unless Spell(howling_blast) or Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(death_and_decay) or Rune(unholy) >= 2 and Spell(plague_strike) or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(plague_strike)
 	{
 		#empower_rune_weapon
 		Spell(empower_rune_weapon)
 	}
 }

-# ActionList: FrostTwoHanderBosStActions --> main, shortcd, cd
+### actions.bos_st --> main, shortcd

-AddFunction FrostTwoHanderBosStActions
+AddFunction FrostTwoHanderBosStMainActions
 {
 	#obliterate,if=buff.killing_machine.react
 	if BuffPresent(killing_machine_buff) Spell(obliterate)
@@ -841,11 +778,9 @@ AddFunction FrostTwoHanderBosStShortCdActions
 	}
 }

-AddFunction FrostTwoHanderBosStCdActions {}
-
-# ActionList: FrostTwoHanderPrecombatActions --> main, shortcd, cd
+### actions.precombat --> main, shortcd, cd

-AddFunction FrostTwoHanderPrecombatActions
+AddFunction FrostTwoHanderPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=calamari_crepes
@@ -853,13 +788,11 @@ AddFunction FrostTwoHanderPrecombatActions
 	if BuffExpires(attack_power_multiplier_buff any=1) Spell(horn_of_winter)
 	#frost_presence
 	Spell(frost_presence)
-	#snapshot_stats
 }

 AddFunction FrostTwoHanderPrecombatShortCdActions
 {
-	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter)
-		or Spell(frost_presence)
+	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter) or Spell(frost_presence)
 	{
 		#pillar_of_frost
 		Spell(pillar_of_frost)
@@ -868,9 +801,9 @@ AddFunction FrostTwoHanderPrecombatShortCdActions

 AddFunction FrostTwoHanderPrecombatCdActions
 {
-	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter)
-		or Spell(frost_presence)
+	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter) or Spell(frost_presence)
 	{
+		#snapshot_stats
 		#army_of_the_dead
 		Spell(army_of_the_dead)
 		#potion,name=draenic_strength
@@ -878,16 +811,14 @@ AddFunction FrostTwoHanderPrecombatCdActions
 	}
 }

-# ActionList: FrostTwoHanderSingleTargetActions --> main, shortcd, cd
+### actions.single_target --> main, shortcd, cd

-AddFunction FrostTwoHanderSingleTargetActions
+AddFunction FrostTwoHanderSingleTargetMainActions
 {
 	#plague_leech,if=disease.min_remains<1
 	if target.DiseasesRemaining() < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
 	#soul_reaper,if=target.health.pct-3*(target.health.pct%target.time_to_die)<=35
 	if target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 Spell(soul_reaper_frost)
-	#defile
-	Spell(defile)
 	#howling_blast,if=buff.rime.react&disease.min_remains>5&buff.killing_machine.react
 	if BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and BuffPresent(killing_machine_buff) Spell(howling_blast)
 	#obliterate,if=buff.killing_machine.react
@@ -897,7 +828,7 @@ AddFunction FrostTwoHanderSingleTargetActions
 	#outbreak,if=!disease.max_ticking
 	if not target.DiseasesAnyTicking() Spell(outbreak)
 	#run_action_list,name=bos_st,if=dot.breath_of_sindragosa.ticking
-	if BuffPresent(breath_of_sindragosa_buff) FrostTwoHanderBosStActions()
+	if BuffPresent(breath_of_sindragosa_buff) FrostTwoHanderBosStMainActions()
 	#obliterate,if=talent.breath_of_sindragosa.enabled&cooldown.breath_of_sindragosa.remains<7&runic_power<76
 	if Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 76 Spell(obliterate)
 	#howling_blast,if=talent.breath_of_sindragosa.enabled&cooldown.breath_of_sindragosa.remains<3&runic_power<88
@@ -932,52 +863,36 @@ AddFunction FrostTwoHanderSingleTargetActions

 AddFunction FrostTwoHanderSingleTargetShortCdActions
 {
-	unless target.DiseasesRemaining() < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-		or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and Spell(soul_reaper_frost)
+	unless target.DiseasesRemaining() < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and Spell(soul_reaper_frost)
 	{
 		#blood_tap,if=(target.health.pct-3*(target.health.pct%target.time_to_die)<=35&cooldown.soul_reaper.remains=0)
 		if target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and not SpellCooldown(soul_reaper_frost) > 0 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+		#defile
+		Spell(defile)
+		#blood_tap,if=talent.defile.enabled&cooldown.defile.remains=0
+		if Talent(defile_talent) and not SpellCooldown(defile) > 0 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)

-		unless Spell(defile)
+		unless BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and BuffPresent(killing_machine_buff) and Spell(howling_blast) or BuffPresent(killing_machine_buff) and Spell(obliterate)
 		{
-			#blood_tap,if=talent.defile.enabled&cooldown.defile.remains=0
-			if Talent(defile_talent) and not SpellCooldown(defile) > 0 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+			#blood_tap,if=buff.killing_machine.react
+			if BuffPresent(killing_machine_buff) and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)

-			unless BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and BuffPresent(killing_machine_buff) and Spell(howling_blast)
-				or BuffPresent(killing_machine_buff) and Spell(obliterate)
+			unless not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and BuffPresent(rime_buff) and Spell(howling_blast) or not target.DiseasesAnyTicking() and Spell(outbreak)
 			{
-				#blood_tap,if=buff.killing_machine.react
-				if BuffPresent(killing_machine_buff) and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+				#unholy_blight,if=!disease.min_ticking
+				if not target.DiseasesTicking() Spell(unholy_blight)
+				#run_action_list,name=bos_st,if=dot.breath_of_sindragosa.ticking
+				if BuffPresent(breath_of_sindragosa_buff) FrostTwoHanderBosStShortCdActions()

-				unless not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and BuffPresent(rime_buff) and Spell(howling_blast)
-					or not target.DiseasesAnyTicking() and Spell(outbreak)
+				unless Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 76 and Spell(obliterate) or Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 3 and RunicPower() < 88 and Spell(howling_blast) or not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and Spell(howling_blast) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(howling_blast) or not Talent(necrotic_plague_talent) and not target.DebuffPresent(blood_plague_debuff) and Spell(plague_strike)
 				{
-					#unholy_blight,if=!disease.min_ticking
-					if not target.DiseasesTicking() Spell(unholy_blight)
-					#run_action_list,name=bos_st,if=dot.breath_of_sindragosa.ticking
-					if BuffPresent(breath_of_sindragosa_buff) FrostTwoHanderBosStShortCdActions()
+					#blood_tap,if=buff.blood_charge.stack>10&runic_power>76
+					if BuffStacks(blood_charge_buff) > 10 and RunicPower() > 76 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)

-					unless Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 76 and Spell(obliterate)
-						or Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 3 and RunicPower() < 88 and Spell(howling_blast)
-						or not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and Spell(howling_blast)
-						or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(howling_blast)
-						or not Talent(necrotic_plague_talent) and not target.DebuffPresent(blood_plague_debuff) and Spell(plague_strike)
+					unless RunicPower() > 76 and Spell(frost_strike) or BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and { Rune(blood) >= 1.8 or Rune(unholy) >= 1.8 or Rune(frost) >= 1.8 } and Spell(howling_blast) or { Rune(blood) >= 1.8 or Rune(unholy) >= 1.8 or Rune(frost) >= 1.8 } and Spell(obliterate) or target.DiseasesRemaining() < 3 and { Rune(blood) <= 0.95 and Rune(unholy) <= 0.95 or Rune(frost) <= 0.95 and Rune(unholy) <= 0.95 or Rune(frost) <= 0.95 and Rune(blood) <= 0.95 } and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or Talent(runic_empowerment_talent) and { Rune(frost) >= 0 and Rune(frost) < 1 or Rune(unholy) >= 0 and Rune(unholy) < 1 or Rune(blood) >= 0 and Rune(blood) < 1 } and { not BuffPresent(killing_machine_buff) or not TimeToSpell(obliterate) <= 1 } and Spell(frost_strike) or Talent(blood_tap_talent) and BuffStacks(blood_charge_buff) <= 10 and { not BuffPresent(killing_machine_buff) or not TimeToSpell(obliterate) <= 1 } and Spell(frost_strike) or BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and Spell(howling_blast) or { Rune(blood) >= 1.5 or Rune(unholy) >= 1.6 or Rune(frost) >= 1.6 or BuffPresent(burst_haste_buff any=1) or SpellCooldown(plague_leech) <= 4 } and Spell(obliterate)
 					{
-						#blood_tap,if=buff.blood_charge.stack>10&runic_power>76
-						if BuffStacks(blood_charge_buff) > 10 and RunicPower() > 76 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-
-						unless RunicPower() > 76 and Spell(frost_strike)
-							or BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and { Rune(blood) >= 1.8 or Rune(unholy) >= 1.8 or Rune(frost) >= 1.8 } and Spell(howling_blast)
-							or { Rune(blood) >= 1.8 or Rune(unholy) >= 1.8 or Rune(frost) >= 1.8 } and Spell(obliterate)
-							or target.DiseasesRemaining() < 3 and { Rune(blood) <= 0.95 and Rune(unholy) <= 0.95 or Rune(frost) <= 0.95 and Rune(unholy) <= 0.95 or Rune(frost) <= 0.95 and Rune(blood) <= 0.95 } and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-							or Talent(runic_empowerment_talent) and { Rune(frost) >= 0 and not Rune(frost) >= 1 or Rune(unholy) >= 0 and not Rune(unholy) >= 1 or Rune(blood) >= 0 and not Rune(blood) >= 1 } and { not BuffPresent(killing_machine_buff) or not TimeToSpell(obliterate) <= 1 } and Spell(frost_strike)
-							or Talent(blood_tap_talent) and BuffStacks(blood_charge_buff) <= 10 and { not BuffPresent(killing_machine_buff) or not TimeToSpell(obliterate) <= 1 } and Spell(frost_strike)
-							or BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and Spell(howling_blast)
-							or { Rune(blood) >= 1.5 or Rune(unholy) >= 1.6 or Rune(frost) >= 1.6 or BuffPresent(burst_haste_buff any=1) or SpellCooldown(plague_leech) <= 4 } and Spell(obliterate)
-						{
-							#blood_tap,if=(buff.blood_charge.stack>10&runic_power>=20)|(blood.frac>=1.4|unholy.frac>=1.6|frost.frac>=1.6)
-							if { BuffStacks(blood_charge_buff) > 10 and RunicPower() >= 20 or Rune(blood) >= 1.4 or Rune(unholy) >= 1.6 or Rune(frost) >= 1.6 } and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-						}
+						#blood_tap,if=(buff.blood_charge.stack>10&runic_power>=20)|(blood.frac>=1.4|unholy.frac>=1.6|frost.frac>=1.6)
+						if { BuffStacks(blood_charge_buff) > 10 and RunicPower() >= 20 or Rune(blood) >= 1.4 or Rune(unholy) >= 1.6 or Rune(frost) >= 1.6 } and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 					}
 				}
 			}
@@ -987,35 +902,12 @@ AddFunction FrostTwoHanderSingleTargetShortCdActions

 AddFunction FrostTwoHanderSingleTargetCdActions
 {
-	unless target.DiseasesRemaining() < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-		or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and Spell(soul_reaper_frost)
-		or Spell(defile)
-		or BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and BuffPresent(killing_machine_buff) and Spell(howling_blast)
-		or BuffPresent(killing_machine_buff) Spell(obliterate)
-		or not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and BuffPresent(rime_buff) and Spell(howling_blast)
-		or not target.DiseasesAnyTicking() and Spell(outbreak)
-		or not target.DiseasesTicking() and Spell(unholy_blight)
+	unless target.DiseasesRemaining() < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and Spell(soul_reaper_frost) or Spell(defile) or BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and BuffPresent(killing_machine_buff) and Spell(howling_blast) or BuffPresent(killing_machine_buff) and Spell(obliterate) or not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and BuffPresent(rime_buff) and Spell(howling_blast) or not target.DiseasesAnyTicking() and Spell(outbreak) or not target.DiseasesTicking() and Spell(unholy_blight)
 	{
 		#breath_of_sindragosa,if=runic_power>75
 		if RunicPower() > 75 Spell(breath_of_sindragosa)
-		#run_action_list,name=bos_st,if=dot.breath_of_sindragosa.ticking
-		if BuffPresent(breath_of_sindragosa_buff) FrostTwoHanderBosStCdActions()
-
-		unless Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 76 and Spell(obliterate)
-			or Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 3 and RunicPower() < 88 and Spell(howling_blast)
-			or not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and Spell(howling_blast)
-			or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(howling_blast)
-			or not Talent(necrotic_plague_talent) and not target.DebuffPresent(blood_plague_debuff) and Spell(plague_strike)
-			or RunicPower() > 76 and Spell(frost_strike)
-			or BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and { Rune(blood) >= 1.8 or Rune(unholy) >= 1.8 or Rune(frost) >= 1.8 } and Spell(howling_blast)
-			or { Rune(blood) >= 1.8 or Rune(unholy) >= 1.8 or Rune(frost) >= 1.8 } and Spell(obliterate)
-			or target.DiseasesRemaining() < 3 and { Rune(blood) <= 0.95 and Rune(unholy) <= 0.95 or Rune(frost) <= 0.95 and Rune(unholy) <= 0.95 or Rune(frost) <= 0.95 and Rune(blood) <= 0.95 } and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-			or Talent(runic_empowerment_talent) and { Rune(frost) >= 0 and not Rune(frost) >= 1 or Rune(unholy) >= 0 and not Rune(unholy) >= 1 or Rune(blood) >= 0 and not Rune(blood) >= 1 } and { not BuffPresent(killing_machine_buff) or not TimeToSpell(obliterate) <= 1 } and Spell(frost_strike)
-			or Talent(blood_tap_talent) and BuffStacks(blood_charge_buff) <= 10 and { not BuffPresent(killing_machine_buff) or not TimeToSpell(obliterate) <= 1 } and Spell(frost_strike)
-			or BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and Spell(howling_blast)
-			or { Rune(blood) >= 1.5 or Rune(unholy) >= 1.6 or Rune(frost) >= 1.6 or BuffPresent(burst_haste_buff any=1) or SpellCooldown(plague_leech) <= 4 } and Spell(obliterate)
-			or not BuffPresent(killing_machine_buff) and Spell(frost_strike)
-			or { Rune(blood) <= 0.95 and Rune(unholy) <= 0.95 or Rune(frost) <= 0.95 and Rune(unholy) <= 0.95 or Rune(frost) <= 0.95 and Rune(blood) <= 0.95 } and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
+
+		unless Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 76 and Spell(obliterate) or Talent(breath_of_sindragosa_talent) and SpellCooldown(breath_of_sindragosa) < 3 and RunicPower() < 88 and Spell(howling_blast) or not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and Spell(howling_blast) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(howling_blast) or not Talent(necrotic_plague_talent) and not target.DebuffPresent(blood_plague_debuff) and Spell(plague_strike) or RunicPower() > 76 and Spell(frost_strike) or BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and { Rune(blood) >= 1.8 or Rune(unholy) >= 1.8 or Rune(frost) >= 1.8 } and Spell(howling_blast) or { Rune(blood) >= 1.8 or Rune(unholy) >= 1.8 or Rune(frost) >= 1.8 } and Spell(obliterate) or target.DiseasesRemaining() < 3 and { Rune(blood) <= 0.95 and Rune(unholy) <= 0.95 or Rune(frost) <= 0.95 and Rune(unholy) <= 0.95 or Rune(frost) <= 0.95 and Rune(blood) <= 0.95 } and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or Talent(runic_empowerment_talent) and { Rune(frost) >= 0 and Rune(frost) < 1 or Rune(unholy) >= 0 and Rune(unholy) < 1 or Rune(blood) >= 0 and Rune(blood) < 1 } and { not BuffPresent(killing_machine_buff) or not TimeToSpell(obliterate) <= 1 } and Spell(frost_strike) or Talent(blood_tap_talent) and BuffStacks(blood_charge_buff) <= 10 and { not BuffPresent(killing_machine_buff) or not TimeToSpell(obliterate) <= 1 } and Spell(frost_strike) or BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 and Spell(howling_blast) or { Rune(blood) >= 1.5 or Rune(unholy) >= 1.6 or Rune(frost) >= 1.6 or BuffPresent(burst_haste_buff any=1) or SpellCooldown(plague_leech) <= 4 } and Spell(obliterate) or not BuffPresent(killing_machine_buff) and Spell(frost_strike) or { Rune(blood) <= 0.95 and Rune(unholy) <= 0.95 or Rune(frost) <= 0.95 and Rune(unholy) <= 0.95 or Rune(frost) <= 0.95 and Rune(blood) <= 0.95 } and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
 		{
 			#empower_rune_weapon
 			Spell(empower_rune_weapon)
@@ -1031,19 +923,19 @@ AddFunction FrostTwoHanderSingleTargetCdActions
 #	spec=unholy
 #	talents=2001002

-# ActionList: UnholyDefaultActions --> main, shortcd, cd
+### actions.default --> main, shortcd, cd

-AddFunction UnholyDefaultActions
+AddFunction UnholyDefaultMainActions
 {
-	#auto_attack
 	#run_action_list,name=aoe,if=active_enemies>=2
-	if Enemies() >= 2 UnholyAoeActions()
+	if Enemies() >= 2 UnholyAoeMainActions()
 	#run_action_list,name=single_target,if=active_enemies<2
-	if Enemies() < 2 UnholySingleTargetActions()
+	if Enemies() < 2 UnholySingleTargetMainActions()
 }

 AddFunction UnholyDefaultShortCdActions
 {
+	#auto_attack
 	#deaths_advance,if=movement.remains>2
 	if 0 > 2 Spell(deaths_advance)
 	#antimagic_shell,damage=100000
@@ -1070,30 +962,24 @@ AddFunction UnholyDefaultCdActions
 	if Enemies() < 2 UnholySingleTargetCdActions()
 }

-# ActionList: UnholyAoeActions --> main, shortcd, cd
+### actions.aoe --> main, shortcd, cd

-AddFunction UnholyAoeActions
+AddFunction UnholyAoeMainActions
 {
 	#run_action_list,name=spread,if=!dot.blood_plague.ticking|!dot.frost_fever.ticking
-	if not target.DebuffPresent(blood_plague_debuff) or not target.DebuffPresent(frost_fever_debuff) UnholySpreadActions()
-	#defile
-	Spell(defile)
+	if not target.DebuffPresent(blood_plague_debuff) or not target.DebuffPresent(frost_fever_debuff) UnholySpreadMainActions()
 	#run_action_list,name=bos_aoe,if=dot.breath_of_sindragosa.ticking
-	if BuffPresent(breath_of_sindragosa_buff) UnholyBosAoeActions()
+	if BuffPresent(breath_of_sindragosa_buff) UnholyBosAoeMainActions()
 	#blood_boil,if=blood=2|(frost=2&death=2)
 	if Rune(blood) >= 2 or Rune(frost) >= 2 and Rune(death) >= 2 and Rune(death) < 3 Spell(blood_boil)
 	#dark_transformation
 	if BuffStacks(shadow_infusion_buff) >= 5 Spell(dark_transformation)
-	#defile
-	Spell(defile)
-	#death_and_decay,if=unholy=1
-	if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(death_and_decay)
 	#soul_reaper,if=target.health.pct-3*(target.health.pct%target.time_to_die)<=45
 	if target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 Spell(soul_reaper_unholy)
 	#scourge_strike,if=unholy=2
 	if Rune(unholy) >= 2 Spell(scourge_strike)
-	#death_coil,if=runic_power>90|buff.sudden_doom.react|(buff.dark_transformation.down&rune.unholy<=1)
-	if RunicPower() > 90 or BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and not Rune(unholy) >= 2 Spell(death_coil)
+	#death_coil,if=runic_power>90|buff.sudden_doom.react|(buff.dark_transformation.down&unholy<=1)
+	if RunicPower() > 90 or BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and Rune(unholy) < 2 Spell(death_coil)
 	#blood_boil
 	Spell(blood_boil)
 	#icy_touch
@@ -1110,42 +996,29 @@ AddFunction UnholyAoeShortCdActions
 {
 	#unholy_blight
 	Spell(unholy_blight)
-	#run_action_list,name=spread,if=!dot.blood_plague.ticking|!dot.frost_fever.ticking
-	if not target.DebuffPresent(blood_plague_debuff) or not target.DebuffPresent(frost_fever_debuff) UnholySpreadShortCdActions()
+	#defile
+	Spell(defile)
+	#run_action_list,name=bos_aoe,if=dot.breath_of_sindragosa.ticking
+	if BuffPresent(breath_of_sindragosa_buff) UnholyBosAoeShortCdActions()

-	unless Spell(defile)
+	unless { Rune(blood) >= 2 or Rune(frost) >= 2 and Rune(death) >= 2 and Rune(death) < 3 } and Spell(blood_boil) or BuffStacks(shadow_infusion_buff) >= 5 and Spell(dark_transformation)
 	{
-		#run_action_list,name=bos_aoe,if=dot.breath_of_sindragosa.ticking
-		if BuffPresent(breath_of_sindragosa_buff) UnholyBosAoeShortCdActions()
-
-		unless { Rune(blood) >= 2 or Rune(frost) >= 2 and Rune(death) >= 2 and Rune(death) < 3 } and Spell(blood_boil)
+		#blood_tap,if=level<=90&buff.shadow_infusion.stack=5
+		if Level() <= 90 and BuffStacks(shadow_infusion_buff) == 5 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+		#defile
+		Spell(defile)
+		#death_and_decay,if=unholy=1
+		if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(death_and_decay)
+
+		unless target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 and Spell(soul_reaper_unholy) or Rune(unholy) >= 2 and Spell(scourge_strike)
 		{
-			#summon_gargoyle
-			Spell(summon_gargoyle)
+			#blood_tap,if=buff.blood_charge.stack>10
+			if BuffStacks(blood_charge_buff) > 10 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)

-			unless BuffStacks(shadow_infusion_buff) >= 5 and Spell(dark_transformation)
+			unless { RunicPower() > 90 or BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and Rune(unholy) < 2 } and Spell(death_coil) or Spell(blood_boil) or Spell(icy_touch) or Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(scourge_strike) or Spell(death_coil)
 			{
-				#blood_tap,if=buff.shadow_infusion.stack=5
-				if BuffStacks(shadow_infusion_buff) == 5 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-
-				unless Spell(defile)
-					or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(death_and_decay)
-					or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 and Spell(soul_reaper_unholy)
-					or Rune(unholy) >= 2 and Spell(scourge_strike)
-				{
-					#blood_tap,if=buff.blood_charge.stack>10
-					if BuffStacks(blood_charge_buff) > 10 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-
-					unless { RunicPower() > 90 or BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and not Rune(unholy) >= 2 } and Spell(death_coil)
-						or Spell(blood_boil)
-						or Spell(icy_touch)
-						or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(scourge_strike)
-						or Spell(death_coil)
-					{
-						#blood_tap
-						if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-					}
-				}
+				#blood_tap
+				if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 			}
 		}
 	}
@@ -1155,9 +1028,6 @@ AddFunction UnholyAoeCdActions
 {
 	unless Spell(unholy_blight)
 	{
-		#run_action_list,name=spread,if=!dot.blood_plague.ticking|!dot.frost_fever.ticking
-		if not target.DebuffPresent(blood_plague_debuff) or not target.DebuffPresent(frost_fever_debuff) UnholySpreadCdActions()
-
 		unless Spell(defile)
 		{
 			#breath_of_sindragosa,if=runic_power>75
@@ -1166,32 +1036,24 @@ AddFunction UnholyAoeCdActions
 			if BuffPresent(breath_of_sindragosa_buff) UnholyBosAoeCdActions()

 			unless { Rune(blood) >= 2 or Rune(frost) >= 2 and Rune(death) >= 2 and Rune(death) < 3 } and Spell(blood_boil)
-				or Spell(summon_gargoyle)
-				or BuffStacks(shadow_infusion_buff) >= 5 and Spell(dark_transformation)
-				or Spell(defile)
-				or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(death_and_decay)
-				or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 and Spell(soul_reaper_unholy)
-				or Rune(unholy) >= 2 and Spell(scourge_strike)
-				or { RunicPower() > 90 or BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and not Rune(unholy) >= 2 } and Spell(death_coil)
-				or Spell(blood_boil)
-				or Spell(icy_touch)
-				or Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(scourge_strike)
-				or Spell(death_coil)
-				or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
 			{
-				#empower_rune_weapon
-				Spell(empower_rune_weapon)
+				#summon_gargoyle
+				Spell(summon_gargoyle)
+
+				unless BuffStacks(shadow_infusion_buff) >= 5 and Spell(dark_transformation) or Spell(defile) or Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(death_and_decay) or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 and Spell(soul_reaper_unholy) or Rune(unholy) >= 2 and Spell(scourge_strike) or { RunicPower() > 90 or BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and Rune(unholy) < 2 } and Spell(death_coil) or Spell(blood_boil) or Spell(icy_touch) or Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(scourge_strike) or Spell(death_coil) or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
+				{
+					#empower_rune_weapon
+					Spell(empower_rune_weapon)
+				}
 			}
 		}
 	}
 }

-# ActionList: UnholyBosAoeActions --> main, shortcd, cd
+### actions.bos_aoe --> main, shortcd, cd

-AddFunction UnholyBosAoeActions
+AddFunction UnholyBosAoeMainActions
 {
-	#death_and_decay,if=runic_power<88
-	if RunicPower() < 88 Spell(death_and_decay)
 	#blood_boil,if=runic_power<88
 	if RunicPower() < 88 Spell(blood_boil)
 	#scourge_strike,if=runic_power<88&unholy=1
@@ -1206,10 +1068,10 @@ AddFunction UnholyBosAoeActions

 AddFunction UnholyBosAoeShortCdActions
 {
-	unless RunicPower() < 88 and Spell(death_and_decay)
-		or RunicPower() < 88 and Spell(blood_boil)
-		or RunicPower() < 88 and Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(scourge_strike)
-		or RunicPower() < 88 and Spell(icy_touch)
+	#death_and_decay,if=runic_power<88
+	if RunicPower() < 88 Spell(death_and_decay)
+
+	unless RunicPower() < 88 and Spell(blood_boil) or RunicPower() < 88 and Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(scourge_strike) or RunicPower() < 88 and Spell(icy_touch)
 	{
 		#blood_tap,if=buff.blood_charge.stack>=5
 		if BuffStacks(blood_charge_buff) >= 5 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
@@ -1218,20 +1080,16 @@ AddFunction UnholyBosAoeShortCdActions

 AddFunction UnholyBosAoeCdActions
 {
-	unless RunicPower() < 88 and Spell(death_and_decay)
-		or RunicPower() < 88 and Spell(blood_boil)
-		or RunicPower() < 88 and Rune(unholy) >= 1 and not Rune(unholy) >= 2 and Spell(scourge_strike)
-		or RunicPower() < 88 and Spell(icy_touch)
-		or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
+	unless RunicPower() < 88 and Spell(death_and_decay) or RunicPower() < 88 and Spell(blood_boil) or RunicPower() < 88 and Rune(unholy) >= 1 and Rune(unholy) < 2 and Spell(scourge_strike) or RunicPower() < 88 and Spell(icy_touch) or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
 	{
 		#empower_rune_weapon
 		Spell(empower_rune_weapon)
 	}
 }

-# ActionList: UnholyBosStActions --> main, shortcd, cd
+### actions.bos_st --> main, shortcd, cd

-AddFunction UnholyBosStActions
+AddFunction UnholyBosStMainActions
 {
 	#festering_strike,if=runic_power<77
 	if RunicPower() < 77 Spell(festering_strike)
@@ -1248,8 +1106,7 @@ AddFunction UnholyBosStShortCdActions
 	#death_and_decay,if=runic_power<88
 	if RunicPower() < 88 Spell(death_and_decay)

-	unless RunicPower() < 77 and Spell(festering_strike)
-		or RunicPower() < 88 and Spell(scourge_strike)
+	unless RunicPower() < 77 and Spell(festering_strike) or RunicPower() < 88 and Spell(scourge_strike)
 	{
 		#blood_tap,if=buff.blood_charge.stack>=5
 		if BuffStacks(blood_charge_buff) >= 5 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
@@ -1258,19 +1115,16 @@ AddFunction UnholyBosStShortCdActions

 AddFunction UnholyBosStCdActions
 {
-	unless RunicPower() < 88 and Spell(death_and_decay)
-		or RunicPower() < 77 and Spell(festering_strike)
-		or RunicPower() < 88 and Spell(scourge_strike)
-		or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
+	unless RunicPower() < 88 and Spell(death_and_decay) or RunicPower() < 77 and Spell(festering_strike) or RunicPower() < 88 and Spell(scourge_strike) or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
 	{
 		#empower_rune_weapon
 		Spell(empower_rune_weapon)
 	}
 }

-# ActionList: UnholyPrecombatActions --> main, shortcd, cd
+### actions.precombat --> main, shortcd, cd

-AddFunction UnholyPrecombatActions
+AddFunction UnholyPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=calamari_crepes
@@ -1278,13 +1132,11 @@ AddFunction UnholyPrecombatActions
 	if BuffExpires(attack_power_multiplier_buff any=1) Spell(horn_of_winter)
 	#unholy_presence
 	Spell(unholy_presence)
-	#snapshot_stats
 }

 AddFunction UnholyPrecombatShortCdActions
 {
-	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter)
-		or Spell(unholy_presence)
+	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter) or Spell(unholy_presence)
 	{
 		#raise_dead
 		Spell(raise_dead)
@@ -1293,9 +1145,9 @@ AddFunction UnholyPrecombatShortCdActions

 AddFunction UnholyPrecombatCdActions
 {
-	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter)
-		or Spell(unholy_presence)
+	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter) or Spell(unholy_presence)
 	{
+		#snapshot_stats
 		#army_of_the_dead
 		Spell(army_of_the_dead)
 		#potion,name=draenic_strength
@@ -1303,9 +1155,9 @@ AddFunction UnholyPrecombatCdActions
 	}
 }

-# ActionList: UnholySingleTargetActions --> main, shortcd, cd
+### actions.single_target --> main, shortcd, cd

-AddFunction UnholySingleTargetActions
+AddFunction UnholySingleTargetMainActions
 {
 	#plague_leech,if=cooldown.outbreak.remains<1
 	if SpellCooldown(outbreak) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
@@ -1317,8 +1169,6 @@ AddFunction UnholySingleTargetActions
 	if target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 Spell(soul_reaper_unholy)
 	#death_coil,if=runic_power>90
 	if RunicPower() > 90 Spell(death_coil)
-	#defile
-	Spell(defile)
 	#dark_transformation
 	if BuffStacks(shadow_infusion_buff) >= 5 Spell(dark_transformation)
 	#outbreak,if=!talent.necrotic_plague.enabled&(!dot.frost_fever.ticking|!dot.blood_plague.ticking)
@@ -1330,7 +1180,7 @@ AddFunction UnholySingleTargetActions
 	#plague_strike,if=talent.necrotic_plague.enabled&!dot.necrotic_plague.ticking
 	if Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) Spell(plague_strike)
 	#run_action_list,name=bos_st,if=dot.breath_of_sindragosa.ticking
-	if BuffPresent(breath_of_sindragosa_buff) UnholyBosStActions()
+	if BuffPresent(breath_of_sindragosa_buff) UnholyBosStMainActions()
 	#scourge_strike,if=cooldown.breath_of_sindragosa.remains<7&runic_power<88&talent.breath_of_sindragosa.enabled
 	if SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Talent(breath_of_sindragosa_talent) Spell(scourge_strike)
 	#festering_strike,if=cooldown.breath_of_sindragosa.remains<7&runic_power<76&talent.breath_of_sindragosa.enabled
@@ -1341,8 +1191,8 @@ AddFunction UnholySingleTargetActions
 	if RunicPower() > 80 Spell(death_coil)
 	#festering_strike,if=blood=2&frost=2
 	if Rune(blood) >= 2 and Rune(frost) >= 2 Spell(festering_strike)
-	#death_coil,if=buff.sudden_doom.react|(buff.dark_transformation.down&rune.unholy<=1)
-	if BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and not Rune(unholy) >= 2 Spell(death_coil)
+	#death_coil,if=buff.sudden_doom.react|(buff.dark_transformation.down&unholy<=1)
+	if BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and Rune(unholy) < 2 Spell(death_coil)
 	#scourge_strike,if=!(target.health.pct-3*(target.health.pct%target.time_to_die)<=45)|(unholy>=1&death>=1)|(death>=2)
 	if not target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 or Rune(unholy) >= 1 and Rune(death) >= 1 or Rune(death) >= 2 Spell(scourge_strike)
 	#festering_strike
@@ -1355,60 +1205,49 @@ AddFunction UnholySingleTargetActions

 AddFunction UnholySingleTargetShortCdActions
 {
-	unless SpellCooldown(outbreak) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-		or not Talent(necrotic_plague_talent) and target.DebuffRemaining(blood_plague_debuff) < 1 and target.DebuffRemaining(frost_fever_debuff) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-		or Talent(necrotic_plague_talent) and target.DebuffRemaining(necrotic_plague_debuff) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-		or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 and Spell(soul_reaper_unholy)
+	unless SpellCooldown(outbreak) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or not Talent(necrotic_plague_talent) and target.DebuffRemaining(blood_plague_debuff) < 1 and target.DebuffRemaining(frost_fever_debuff) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or Talent(necrotic_plague_talent) and target.DebuffRemaining(necrotic_plague_debuff) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 and Spell(soul_reaper_unholy)
 	{
 		#blood_tap,if=(target.health.pct-3*(target.health.pct%target.time_to_die)<=45&cooldown.soul_reaper.remains=0)
 		if target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 and not SpellCooldown(soul_reaper_unholy) > 0 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-		#summon_gargoyle
-		Spell(summon_gargoyle)

 		unless RunicPower() > 90 and Spell(death_coil)
-			or Spell(defile)
-			or BuffStacks(shadow_infusion_buff) >= 5 and Spell(dark_transformation)
 		{
-			#unholy_blight,if=!talent.necrotic_plague.enabled&(dot.frost_fever.remains<3|dot.blood_plague.remains<3)
-			if not Talent(necrotic_plague_talent) and { target.DebuffRemaining(frost_fever_debuff) < 3 or target.DebuffRemaining(blood_plague_debuff) < 3 } Spell(unholy_blight)
-			#unholy_blight,if=talent.necrotic_plague.enabled&dot.necrotic_plague.remains<1
-			if Talent(necrotic_plague_talent) and target.DebuffRemaining(necrotic_plague_debuff) < 1 Spell(unholy_blight)
-
-			unless not Talent(necrotic_plague_talent) and { not target.DebuffPresent(frost_fever_debuff) or not target.DebuffPresent(blood_plague_debuff) } and Spell(outbreak)
-				or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(outbreak)
-				or not Talent(necrotic_plague_talent) and { not target.DebuffPresent(blood_plague_debuff) or not target.DebuffPresent(frost_fever_debuff) } and Spell(plague_strike)
-				or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(plague_strike)
+			#defile
+			Spell(defile)
+
+			unless BuffStacks(shadow_infusion_buff) >= 5 and Spell(dark_transformation)
 			{
-				#run_action_list,name=bos_st,if=dot.breath_of_sindragosa.ticking
-				if BuffPresent(breath_of_sindragosa_buff) UnholyBosStShortCdActions()
-				#death_and_decay,if=cooldown.breath_of_sindragosa.remains<7&runic_power<88&talent.breath_of_sindragosa.enabled
-				if SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Talent(breath_of_sindragosa_talent) Spell(death_and_decay)
+				#unholy_blight,if=!talent.necrotic_plague.enabled&(dot.frost_fever.remains<3|dot.blood_plague.remains<3)
+				if not Talent(necrotic_plague_talent) and { target.DebuffRemaining(frost_fever_debuff) < 3 or target.DebuffRemaining(blood_plague_debuff) < 3 } Spell(unholy_blight)
+				#unholy_blight,if=talent.necrotic_plague.enabled&dot.necrotic_plague.remains<1
+				if Talent(necrotic_plague_talent) and target.DebuffRemaining(necrotic_plague_debuff) < 1 Spell(unholy_blight)

-				unless SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Talent(breath_of_sindragosa_talent) and Spell(scourge_strike)
-					or SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 76 and Talent(breath_of_sindragosa_talent) and Spell(festering_strike)
+				unless not Talent(necrotic_plague_talent) and { not target.DebuffPresent(frost_fever_debuff) or not target.DebuffPresent(blood_plague_debuff) } and Spell(outbreak) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(outbreak) or not Talent(necrotic_plague_talent) and { not target.DebuffPresent(blood_plague_debuff) or not target.DebuffPresent(frost_fever_debuff) } and Spell(plague_strike) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(plague_strike)
 				{
-					#death_and_decay,if=unholy=2
-					if Rune(unholy) >= 2 Spell(death_and_decay)
-					#blood_tap,if=unholy=2&cooldown.death_and_decay.remains=0
-					if Rune(unholy) >= 2 and not SpellCooldown(death_and_decay) > 0 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-
-					unless Rune(unholy) >= 2 and Spell(scourge_strike)
-						or RunicPower() > 80 and Spell(death_coil)
-						or Rune(blood) >= 2 and Rune(frost) >= 2 and Spell(festering_strike)
+					#run_action_list,name=bos_st,if=dot.breath_of_sindragosa.ticking
+					if BuffPresent(breath_of_sindragosa_buff) UnholyBosStShortCdActions()
+					#death_and_decay,if=cooldown.breath_of_sindragosa.remains<7&runic_power<88&talent.breath_of_sindragosa.enabled
+					if SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Talent(breath_of_sindragosa_talent) Spell(death_and_decay)
+
+					unless SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Talent(breath_of_sindragosa_talent) and Spell(scourge_strike) or SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 76 and Talent(breath_of_sindragosa_talent) and Spell(festering_strike)
 					{
-						#death_and_decay
-						Spell(death_and_decay)
-						#blood_tap,if=cooldown.death_and_decay.remains=0
-						if not SpellCooldown(death_and_decay) > 0 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-						#blood_tap,if=buff.blood_charge.stack>10&(buff.sudden_doom.react|(buff.dark_transformation.down&rune.unholy<=1))
-						if BuffStacks(blood_charge_buff) > 10 and { BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and not Rune(unholy) >= 2 } and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-
-						unless BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and not Rune(unholy) >= 2 and Spell(death_coil)
-							or { not target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 or Rune(unholy) >= 1 and Rune(death) >= 1 or Rune(death) >= 2 } and Spell(scourge_strike)
-							or Spell(festering_strike)
+						#death_and_decay,if=unholy=2
+						if Rune(unholy) >= 2 Spell(death_and_decay)
+
+						unless Rune(unholy) >= 2 and Spell(scourge_strike) or RunicPower() > 80 and Spell(death_coil) or Rune(blood) >= 2 and Rune(frost) >= 2 and Spell(festering_strike)
 						{
-							#blood_tap,if=buff.blood_charge.stack>=10&runic_power>=30
-							if BuffStacks(blood_charge_buff) >= 10 and RunicPower() >= 30 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+							#death_and_decay
+							Spell(death_and_decay)
+							#blood_tap,if=cooldown.death_and_decay.remains=0
+							if not SpellCooldown(death_and_decay) > 0 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+							#blood_tap,if=buff.blood_charge.stack>10&(buff.sudden_doom.react|(buff.dark_transformation.down&unholy<=1))
+							if BuffStacks(blood_charge_buff) > 10 and { BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and Rune(unholy) < 2 } and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+
+							unless { BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and Rune(unholy) < 2 } and Spell(death_coil) or { not target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 or Rune(unholy) >= 1 and Rune(death) >= 1 or Rune(death) >= 2 } and Spell(scourge_strike) or Spell(festering_strike)
+							{
+								#blood_tap,if=buff.blood_charge.stack>=10&runic_power>=30
+								if BuffStacks(blood_charge_buff) >= 10 and RunicPower() >= 30 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+							}
 						}
 					}
 				}
@@ -1419,49 +1258,30 @@ AddFunction UnholySingleTargetShortCdActions

 AddFunction UnholySingleTargetCdActions
 {
-	unless SpellCooldown(outbreak) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-		or not Talent(necrotic_plague_talent) and target.DebuffRemaining(blood_plague_debuff) < 1 and target.DebuffRemaining(frost_fever_debuff) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-		or Talent(necrotic_plague_talent) and target.DebuffRemaining(necrotic_plague_debuff) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
-		or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and Spell(soul_reaper_unholy)
-		or Spell(summon_gargoyle)
-		or RunicPower() > 90 and Spell(death_coil)
-		or Spell(defile)
-		or BuffStacks(shadow_infusion_buff) >= 5 and Spell(dark_transformation)
-		or not Talent(necrotic_plague_talent) and { target.DebuffRemaining(frost_fever_debuff) < 3 or target.DebuffRemaining(blood_plague_debuff) < 3 } and Spell(unholy_blight)
-		or Talent(necrotic_plague_talent) and target.DebuffRemaining(necrotic_plague_debuff) < 1 and Spell(unholy_blight)
-		or not Talent(necrotic_plague_talent) and { not target.DebuffPresent(frost_fever_debuff) or not target.DebuffPresent(blood_plague_debuff) } and Spell(outbreak)
-		or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(outbreak)
-		or not Talent(necrotic_plague_talent) and { not target.DebuffPresent(blood_plague_debuff) or not target.DebuffPresent(frost_fever_debuff) } and Spell(plague_strike)
-		or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(plague_strike)
+	unless SpellCooldown(outbreak) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or not Talent(necrotic_plague_talent) and target.DebuffRemaining(blood_plague_debuff) < 1 and target.DebuffRemaining(frost_fever_debuff) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or Talent(necrotic_plague_talent) and target.DebuffRemaining(necrotic_plague_debuff) < 1 and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech) or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 and Spell(soul_reaper_unholy)
 	{
-		#breath_of_sindragosa,if=runic_power>75
-		if RunicPower() > 75 Spell(breath_of_sindragosa)
-		#run_action_list,name=bos_st,if=dot.breath_of_sindragosa.ticking
-		if BuffPresent(breath_of_sindragosa_buff) UnholyBosStCdActions()
-
-		unless SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Talent(breath_of_sindragosa_talent) and Spell(death_and_decay)
-			or SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Talent(breath_of_sindragosa_talent) and Spell(scourge_strike)
-			or SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 76 and Talent(breath_of_sindragosa_talent) and Spell(festering_strike)
-			or Rune(unholy) >= 2 and Spell(death_and_decay)
-			or Rune(unholy) >= 2 and Spell(scourge_strike)
-			or RunicPower() > 80 and Spell(death_coil)
-			or Rune(blood) >= 2 and Rune(frost) >= 2 and Spell(festering_strike)
-			or Spell(death_and_decay)
-			or BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and not Rune(unholy) >= 2 and Spell(death_coil)
-			or { not target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 or Rune(unholy) >= 1 and Rune(death) >= 1 or Rune(death) >= 2 } and Spell(scourge_strike)
-			or Spell(festering_strike)
-			or Spell(death_coil)
-			or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
+		#summon_gargoyle
+		Spell(summon_gargoyle)
+
+		unless RunicPower() > 90 and Spell(death_coil) or Spell(defile) or BuffStacks(shadow_infusion_buff) >= 5 and Spell(dark_transformation) or not Talent(necrotic_plague_talent) and { target.DebuffRemaining(frost_fever_debuff) < 3 or target.DebuffRemaining(blood_plague_debuff) < 3 } and Spell(unholy_blight) or Talent(necrotic_plague_talent) and target.DebuffRemaining(necrotic_plague_debuff) < 1 and Spell(unholy_blight) or not Talent(necrotic_plague_talent) and { not target.DebuffPresent(frost_fever_debuff) or not target.DebuffPresent(blood_plague_debuff) } and Spell(outbreak) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(outbreak) or not Talent(necrotic_plague_talent) and { not target.DebuffPresent(blood_plague_debuff) or not target.DebuffPresent(frost_fever_debuff) } and Spell(plague_strike) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) and Spell(plague_strike)
 		{
-			#empower_rune_weapon
-			Spell(empower_rune_weapon)
+			#breath_of_sindragosa,if=runic_power>75
+			if RunicPower() > 75 Spell(breath_of_sindragosa)
+			#run_action_list,name=bos_st,if=dot.breath_of_sindragosa.ticking
+			if BuffPresent(breath_of_sindragosa_buff) UnholyBosStCdActions()
+
+			unless SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Talent(breath_of_sindragosa_talent) and Spell(death_and_decay) or SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 88 and Talent(breath_of_sindragosa_talent) and Spell(scourge_strike) or SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 76 and Talent(breath_of_sindragosa_talent) and Spell(festering_strike) or Rune(unholy) >= 2 and Spell(death_and_decay) or Rune(unholy) >= 2 and Spell(scourge_strike) or RunicPower() > 80 and Spell(death_coil) or Rune(blood) >= 2 and Rune(frost) >= 2 and Spell(festering_strike) or Spell(death_and_decay) or { BuffPresent(sudden_doom_buff) or pet.BuffExpires(dark_transformation_buff any=1) and Rune(unholy) < 2 } and Spell(death_coil) or { not target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 45 or Rune(unholy) >= 1 and Rune(death) >= 1 or Rune(death) >= 2 } and Spell(scourge_strike) or Spell(festering_strike) or Spell(death_coil) or target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
+			{
+				#empower_rune_weapon
+				Spell(empower_rune_weapon)
+			}
 		}
 	}
 }

-# ActionList: UnholySpreadActions --> main, shortcd, cd
+### actions.spread --> main

-AddFunction UnholySpreadActions
+AddFunction UnholySpreadMainActions
 {
 	#blood_boil,cycle_targets=1,if=dot.blood_plague.ticking|dot.frost_fever.ticking
 	if target.DebuffPresent(blood_plague_debuff) or target.DebuffPresent(frost_fever_debuff) Spell(blood_boil)
@@ -1474,10 +1294,6 @@ AddFunction UnholySpreadActions
 	#plague_strike,if=talent.necrotic_plague.enabled&!dot.necrotic_plague.ticking
 	if Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) Spell(plague_strike)
 }
-
-AddFunction UnholySpreadShortCdActions {}
-
-AddFunction UnholySpreadCdActions {}
 ]]
 	OvaleScripts:RegisterScript("DEATHKNIGHT", name, desc, code, "include")
 end
@@ -1537,12 +1353,12 @@ AddIcon specialization=frost help=shortcd enemies=1 checkbox=!opt_deathknight_fr
 {
 	if HasWeapon(offhand)
 	{
-		if InCombat(no) FrostDualWieldPrecombatShortCdActions()
+		if not InCombat() FrostDualWieldPrecombatShortCdActions()
 		FrostDualWieldDefaultShortCdActions()
 	}
 	if HasWeapon(offhand no)
 	{
-		if InCombat(no) FrostTwoHanderPrecombatShortCdActions()
+		if not InCombat() FrostTwoHanderPrecombatShortCdActions()
 		FrostTwoHanderDefaultShortCdActions()
 	}
 }
@@ -1551,12 +1367,12 @@ AddIcon specialization=frost help=shortcd checkbox=opt_deathknight_frost_aoe
 {
 	if HasWeapon(offhand)
 	{
-		if InCombat(no) FrostDualWieldPrecombatShortCdActions()
+		if not InCombat() FrostDualWieldPrecombatShortCdActions()
 		FrostDualWieldDefaultShortCdActions()
 	}
 	if HasWeapon(offhand no)
 	{
-		if InCombat(no) FrostTwoHanderPrecombatShortCdActions()
+		if not InCombat() FrostTwoHanderPrecombatShortCdActions()
 		FrostTwoHanderDefaultShortCdActions()
 	}
 }
@@ -1565,13 +1381,13 @@ AddIcon specialization=frost help=main enemies=1
 {
 	if HasWeapon(offhand)
 	{
-		if InCombat(no) FrostDualWieldPrecombatActions()
-		FrostDualWieldDefaultActions()
+		if not InCombat() FrostDualWieldPrecombatMainActions()
+		FrostDualWieldDefaultMainActions()
 	}
 	if HasWeapon(offhand no)
 	{
-		if InCombat(no) FrostTwoHanderPrecombatActions()
-		FrostTwoHanderDefaultActions()
+		if not InCombat() FrostTwoHanderPrecombatMainActions()
+		FrostTwoHanderDefaultMainActions()
 	}
 }

@@ -1579,13 +1395,13 @@ AddIcon specialization=frost help=aoe checkbox=opt_deathknight_frost_aoe
 {
 	if HasWeapon(offhand)
 	{
-		if InCombat(no) FrostDualWieldPrecombatActions()
-		FrostDualWieldDefaultActions()
+		if not InCombat() FrostDualWieldPrecombatMainActions()
+		FrostDualWieldDefaultMainActions()
 	}
 	if HasWeapon(offhand no)
 	{
-		if InCombat(no) FrostTwoHanderPrecombatActions()
-		FrostTwoHanderDefaultActions()
+		if not InCombat() FrostTwoHanderPrecombatMainActions()
+		FrostTwoHanderDefaultMainActions()
 	}
 }

@@ -1593,12 +1409,12 @@ AddIcon specialization=frost help=cd enemies=1 checkbox=!opt_deathknight_frost_a
 {
 	if HasWeapon(offhand)
 	{
-		if InCombat(no) FrostDualWieldPrecombatCdActions()
+		if not InCombat() FrostDualWieldPrecombatCdActions()
 		FrostDualWieldDefaultCdActions()
 	}
 	if HasWeapon(offhand no)
 	{
-		if InCombat(no) FrostTwoHanderPrecombatCdActions()
+		if not InCombat() FrostTwoHanderPrecombatCdActions()
 		FrostTwoHanderDefaultCdActions()
 	}
 }
@@ -1607,12 +1423,12 @@ AddIcon specialization=frost help=cd checkbox=opt_deathknight_frost_aoe
 {
 	if HasWeapon(offhand)
 	{
-		if InCombat(no) FrostDualWieldPrecombatCdActions()
+		if not InCombat() FrostDualWieldPrecombatCdActions()
 		FrostDualWieldDefaultCdActions()
 	}
 	if HasWeapon(offhand no)
 	{
-		if InCombat(no) FrostTwoHanderPrecombatCdActions()
+		if not InCombat() FrostTwoHanderPrecombatCdActions()
 		FrostTwoHanderDefaultCdActions()
 	}
 }
@@ -1622,37 +1438,37 @@ AddCheckBox(opt_deathknight_unholy_aoe L(AOE) specialization=unholy default)

 AddIcon specialization=unholy help=shortcd enemies=1 checkbox=!opt_deathknight_unholy_aoe
 {
-	if InCombat(no) UnholyPrecombatShortCdActions()
+	if not InCombat() UnholyPrecombatShortCdActions()
 	UnholyDefaultShortCdActions()
 }

 AddIcon specialization=unholy help=shortcd checkbox=opt_deathknight_unholy_aoe
 {
-	if InCombat(no) UnholyPrecombatShortCdActions()
+	if not InCombat() UnholyPrecombatShortCdActions()
 	UnholyDefaultShortCdActions()
 }

 AddIcon specialization=unholy help=main enemies=1
 {
-	if InCombat(no) UnholyPrecombatActions()
-	UnholyDefaultActions()
+	if not InCombat() UnholyPrecombatMainActions()
+	UnholyDefaultMainActions()
 }

 AddIcon specialization=unholy help=aoe checkbox=opt_deathknight_unholy_aoe
 {
-	if InCombat(no) UnholyPrecombatActions()
-	UnholyDefaultActions()
+	if not InCombat() UnholyPrecombatMainActions()
+	UnholyDefaultMainActions()
 }

 AddIcon specialization=unholy help=cd enemies=1 checkbox=!opt_deathknight_unholy_aoe
 {
-	if InCombat(no) UnholyPrecombatCdActions()
+	if not InCombat() UnholyPrecombatCdActions()
 	UnholyDefaultCdActions()
 }

 AddIcon specialization=unholy help=cd checkbox=opt_deathknight_unholy_aoe
 {
-	if InCombat(no) UnholyPrecombatCdActions()
+	if not InCombat() UnholyPrecombatCdActions()
 	UnholyDefaultCdActions()
 }
 ]]
diff --git a/scripts/ovale_druid.lua b/scripts/ovale_druid.lua
index 8fe9ce2..0ad3ca5 100644
--- a/scripts/ovale_druid.lua
+++ b/scripts/ovale_druid.lua
@@ -57,21 +57,20 @@ AddFunction InterruptActions
 #	talents=3002002
 #	glyphs=savage_roar

-# ActionList: FeralDefaultActions --> main, predict, shortcd, cd
+### actions.default --> main, shortcd, cd

-AddFunction FeralDefaultActions
+AddFunction FeralDefaultMainActions
 {
 	#cat_form
 	Spell(cat_form)
 	#rake,if=buff.prowl.up|buff.shadowmeld.up
 	if BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) Spell(rake)
-	#auto_attack
 	#ferocious_bite,cycle_targets=1,if=dot.rip.ticking&dot.rip.remains<3&target.health.pct<25
 	if target.DebuffPresent(rip_debuff) and target.DebuffRemaining(rip_debuff) < 3 and target.HealthPercent() < 25 Spell(ferocious_bite)
 	#healing_touch,if=talent.bloodtalons.enabled&buff.predatory_swiftness.up&(combo_points>=4|buff.predatory_swiftness.remains<1.5)
 	if Talent(bloodtalons_talent) and BuffPresent(predatory_swiftness_buff) and { ComboPoints() >= 4 or BuffRemaining(predatory_swiftness_buff) < 1.5 } Spell(healing_touch)
 	#savage_roar,if=buff.savage_roar.remains<3
-	if BuffRemaining(savage_roar_buff) < 3 Spell(savage_roar)
+	if BuffRemaining(savage_roar_buff any=1) < 3 Spell(savage_roar)
 	#thrash_cat,cycle_targets=1,if=buff.omen_of_clarity.react&remains<4.5&active_enemies>1
 	if BuffPresent(omen_of_clarity_melee_buff) and target.DebuffRemaining(thrash_cat_debuff) < 4.5 and Enemies() > 1 Spell(thrash_cat)
 	#thrash_cat,cycle_targets=1,if=!talent.bloodtalons.enabled&combo_points=5&remains<4.5&buff.omen_of_clarity.react
@@ -82,40 +81,11 @@ AddFunction FeralDefaultActions
 	unless target.DebuffRemaining(thrash_cat_debuff) < 4.5 and Enemies() > 1 and SpellUsable(thrash_cat) and SpellCooldown(thrash_cat) < TimeToEnergyFor(thrash_cat)
 	{
 		#call_action_list,name=finisher,if=combo_points=5
-		if ComboPoints() == 5 FeralFinisherActions()
+		if ComboPoints() == 5 FeralFinisherMainActions()
 		#call_action_list,name=maintain
-		FeralMaintainActions()
+		FeralMaintainMainActions()
 		#call_action_list,name=generator,if=combo_points<5
-		if ComboPoints() < 5 FeralGeneratorActions()
-	}
-}
-
-AddFunction FeralDefaultPredictActions
-{
-	#cat_form
-	Spell(cat_form)
-	#rake,if=buff.prowl.up|buff.shadowmeld.up
-	if BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) Spell(rake)
-	#auto_attack
-	#ferocious_bite,cycle_targets=1,if=dot.rip.ticking&dot.rip.remains<3&target.health.pct<25
-	if target.DebuffPresent(rip_debuff) and target.DebuffRemaining(rip_debuff) < 3 and target.HealthPercent() < 25 Spell(ferocious_bite)
-	#healing_touch,if=talent.bloodtalons.enabled&buff.predatory_swiftness.up&(combo_points>=4|buff.predatory_swiftness.remains<1.5)
-	if Talent(bloodtalons_talent) and BuffPresent(predatory_swiftness_buff) and { ComboPoints() >= 4 or BuffRemaining(predatory_swiftness_buff) < 1.5 } Spell(healing_touch)
-	#savage_roar,if=buff.savage_roar.remains<3
-	if BuffRemaining(savage_roar_buff) < 3 Spell(savage_roar)
-	#thrash_cat,cycle_targets=1,if=buff.omen_of_clarity.react&remains<4.5&active_enemies>1
-	if BuffPresent(omen_of_clarity_melee_buff) and target.DebuffRemaining(thrash_cat_debuff) < 4.5 and Enemies() > 1 Spell(thrash_cat)
-	#thrash_cat,cycle_targets=1,if=!talent.bloodtalons.enabled&combo_points=5&remains<4.5&buff.omen_of_clarity.react
-	if not Talent(bloodtalons_talent) and ComboPoints() == 5 and target.DebuffRemaining(thrash_cat_debuff) < 4.5 and BuffPresent(omen_of_clarity_melee_buff) Spell(thrash_cat)
-	#pool_resource,for_next=1
-	#thrash_cat,cycle_targets=1,if=remains<4.5&active_enemies>1
-	if target.DebuffRemaining(thrash_cat_debuff) < 4.5 and Enemies() > 1 Spell(thrash_cat)
-	unless target.DebuffRemaining(thrash_cat_debuff) < 4.5 and Enemies() > 1 and SpellUsable(thrash_cat) and SpellCooldown(thrash_cat) < TimeToEnergyFor(thrash_cat)
-	{
-		#call_action_list,name=finisher,if=combo_points=5
-		if ComboPoints() == 5 FeralFinisherPredictActions()
-		#call_action_list,name=maintain
-		FeralMaintainPredictActions()
+		if ComboPoints() < 5 FeralGeneratorMainActions()
 	}
 }

@@ -123,9 +93,8 @@ AddFunction FeralDefaultShortCdActions
 {
 	unless Spell(cat_form)
 	{
-		# CHANGE: Get within melee range of the target.
+		#wild_charge
 		GetInMeleeRange()
-		if target.InRange(wild_charge) Spell(wild_charge)
 		#displacer_beast,if=movement.distance>10
 		if 0 > 10 Spell(displacer_beast)
 		#dash,if=movement.distance&buff.displacer_beast.down&buff.wild_charge_movement.down
@@ -148,37 +117,47 @@ AddFunction FeralTigersFurySyncCondition
 	BuffPresent(tigers_fury_buff) or { not BuffPresent(omen_of_clarity_melee_buff) and MaxEnergy() - Energy() >= 60 or MaxEnergy() - Energy() >= 80 } and not SpellCooldown(tigers_fury) > 0
 }

+AddFunction FeralBerserkSyncCondition
+{
+	# CHANGE: Synchronize with Tiger's Fury conditions.
+	#berserk,if=buff.tigers_fury.up
+	#if BuffPresent(tigers_fury_buff) Spell(berserk_cat)
+	#if FeralTigersFurySyncCondition() Spell(berserk_cat)
+	BuffPresent(berserk_cat_buff) or { FeralTigersFurySyncCondition() and not SpellCooldown(berserk_cat) > 0 }
+}
+
 AddFunction FeralDefaultCdActions
 {
-	unless Spell(cat_form)
-		or target.InRange(wild_charge) and Spell(wild_charge)
-		or 0 > 10 and Spell(displacer_beast)
-		or 0 and BuffExpires(displacer_beast_buff) and True(wild_charge_movement_down) and Spell(dash)
-		or { BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) } and Spell(rake)
+	unless Spell(cat_form) or 0 > 10 and Spell(displacer_beast) or 0 and BuffExpires(displacer_beast_buff) and True(wild_charge_movement_down) and Spell(dash) or { BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) } and Spell(rake)
 	{
+		#auto_attack
+		#skull_bash
 		InterruptActions()
 		#potion,name=draenic_agility,if=target.time_to_die<=40
 		if target.TimeToDie() <= 40 UsePotionAgility()
-		# CHANGE: Synchronize abilities that are used with Tiger's Fury using Tiger Fury's conditions.
-		#tigers_fury,if=(!buff.omen_of_clarity.react&energy.max-energy>=60)|energy.max-energy>=80
+		# CHANGE: Synchronize with Tiger's Fury conditions.
 		#use_item,slot=trinket1,sync=tigers_fury
-		if not SpellCooldown(tigers_fury) > 0 UseItemActions()
+		#if not SpellCooldown(tigers_fury) > 0 UseItemActions()
 		if FeralTigersFurySyncCondition() UseItemActions()
+		# CHANGE: Synchronize with Tiger's Fury conditions.
 		#blood_fury,sync=tigers_fury
 		#if not SpellCooldown(tigers_fury) > 0 Spell(blood_fury_apsp)
 		if FeralTigersFurySyncCondition() Spell(blood_fury_apsp)
+		# CHANGE: Synchronize with Tiger's Fury conditions.
 		#berserking,sync=tigers_fury
 		#if not SpellCooldown(tigers_fury) > 0 Spell(berserking)
 		if FeralTigersFurySyncCondition() Spell(berserking)
+		# CHANGE: Synchronize with Tiger's Fury conditions.
 		#arcane_torrent,sync=tigers_fury
 		#if not SpellCooldown(tigers_fury) > 0 Spell(arcane_torrent_energy)
 		if FeralTigersFurySyncCondition() Spell(arcane_torrent_energy)
-		if FeralTigersFurySyncCondition() Spell(incarnation_melee)
 		#incarnation,if=cooldown.berserk.remains<10&energy.time_to_max>1
 		if SpellCooldown(berserk_cat) < 10 and TimeToMaxEnergy() > 1 Spell(incarnation_melee)
+		# CHANGE: Synchronize with Berserk's conditions.
 		#potion,name=draenic_agility,sync=berserk,if=target.health.pct<25
 		#if target.HealthPercent() < 25 and not SpellCooldown(berserk_cat) > 0 UsePotionAgility()
-		if target.HealthPercent() < 25 and { BuffPresent(berserk_cat_buff) or FeralTigersFurySyncCondition() and SpellCooldown(berserk_cat) > 0 } UsePotionAgility()
+		if target.HealthPercent() < 25 and FeralBerserkSyncCondition() UsePotionAgility()
+		# CHANGE: Synchronize with Tiger's Fury conditions.
 		#berserk,if=buff.tigers_fury.up
 		#if BuffPresent(tigers_fury_buff) Spell(berserk_cat)
 		if FeralTigersFurySyncCondition() Spell(berserk_cat)
@@ -187,14 +166,9 @@ AddFunction FeralDefaultCdActions
 	}
 }

-# ActionList: FeralFinisherActions --> main, predict
-
-AddFunction FeralFinisherActions
-{
-	FeralFinisherPredictActions()
-}
+### actions.finisher --> main

-AddFunction FeralFinisherPredictActions
+AddFunction FeralFinisherMainActions
 {
 	#ferocious_bite,cycle_targets=1,max_energy=1,if=target.health.pct<25&dot.rip.ticking
 	if Energy() >= EnergyCost(ferocious_bite max=1) and target.HealthPercent() < 25 and target.DebuffPresent(rip_debuff) Spell(ferocious_bite)
@@ -203,14 +177,14 @@ AddFunction FeralFinisherPredictActions
 	#rip,cycle_targets=1,if=remains<7.2&persistent_multiplier>dot.rip.pmultiplier&target.time_to_die-remains>18
 	if target.DebuffRemaining(rip_debuff) < 7.2 and PersistentMultiplier(rip_debuff) > target.DebuffPersistentMultiplier(rip_debuff) and target.TimeToDie() - target.DebuffRemaining(rip_debuff) > 18 Spell(rip)
 	#savage_roar,if=(energy.time_to_max<=1|buff.berserk.up|cooldown.tigers_fury.remains<3)&buff.savage_roar.remains<12.6
-	if { TimeToMaxEnergy() <= 1 or BuffPresent(berserk_cat_buff) or SpellCooldown(tigers_fury) < 3 } and BuffRemaining(savage_roar_buff) < 12.6 Spell(savage_roar)
+	if { TimeToMaxEnergy() <= 1 or BuffPresent(berserk_cat_buff) or SpellCooldown(tigers_fury) < 3 } and BuffRemaining(savage_roar_buff any=1) < 12.6 Spell(savage_roar)
 	#ferocious_bite,max_energy=1,if=(energy.time_to_max<=1|buff.berserk.up|cooldown.tigers_fury.remains<3)
 	if Energy() >= EnergyCost(ferocious_bite max=1) and { TimeToMaxEnergy() <= 1 or BuffPresent(berserk_cat_buff) or SpellCooldown(tigers_fury) < 3 } Spell(ferocious_bite)
 }

-# ActionList: FeralGeneratorActions --> main
+### actions.generator --> main

-AddFunction FeralGeneratorActions
+AddFunction FeralGeneratorMainActions
 {
 	#swipe,if=active_enemies>=3
 	if Enemies() >= 3 Spell(swipe)
@@ -218,14 +192,9 @@ AddFunction FeralGeneratorActions
 	if Enemies() < 3 Spell(shred)
 }

-# ActionList: FeralMaintainActions --> main, predict
+### actions.maintain --> main

-AddFunction FeralMaintainActions
-{
-	FeralMaintainPredictActions()
-}
-
-AddFunction FeralMaintainPredictActions
+AddFunction FeralMaintainMainActions
 {
 	#rake,cycle_targets=1,if=!talent.bloodtalons.enabled&remains<3&combo_points<5&((target.time_to_die-remains>3&active_enemies<3)|target.time_to_die-remains>6)
 	if not Talent(bloodtalons_talent) and target.DebuffRemaining(rake_debuff) < 3 and ComboPoints() < 5 and { target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 3 and Enemies() < 3 or target.TimeToDie() - target.DebuffRemaining(rake_debuff) > 6 } Spell(rake)
@@ -241,15 +210,15 @@ AddFunction FeralMaintainPredictActions
 	if PersistentMultiplier(rake_debuff) > target.DebuffPersistentMultiplier(rake_debuff) and ComboPoints() < 5 and Enemies() == 1 Spell(rake)
 }

-# ActionList: FeralPrecombatActions --> main, predict, shortcd, main
+### actions.precombat --> main, cd

-AddFunction FeralPrecombatActions
+AddFunction FeralPrecombatMainActions
 {
 	#flask,type=greater_draenic_agility_flask
 	#food,type=blackrock_barbecue
 	#mark_of_the_wild,if=!aura.str_agi_int.up
 	if not BuffPresent(str_agi_int_buff any=1) Spell(mark_of_the_wild)
-	# CHANGE: Cast Healing Touch to gain Bloodtalons buff if less than 20s remaining on the buff.
+	# CHANGE: Cast Healing Touch to gain Bloodtalons buff only if less than 20s remaining on the buff.
 	#healing_touch,if=talent.bloodtalons.enabled
 	#if Talent(bloodtalons_talent) Spell(healing_touch)
 	if Talent(bloodtalons_talent) and BuffRemaining(bloodtalons_buff) < 20 Spell(healing_touch)
@@ -257,19 +226,13 @@ AddFunction FeralPrecombatActions
 	Spell(cat_form)
 	#prowl
 	if BuffExpires(stealthed_buff any=1) Spell(prowl)
-	#snapshot_stats
 }

-AddFunction FeralPrecombatPredictActions {}
-
-AddFunction FeralPrecombatShortCdActions {}
-
 AddFunction FeralPrecombatCdActions
 {
-	unless not BuffPresent(str_agi_int_buff any=1) and Spell(mark_of_the_wild)
-		or Spell(cat_form)
-		or BuffExpires(stealthed_buff any=1) and Spell(prowl)
+	unless not BuffPresent(str_agi_int_buff any=1) and Spell(mark_of_the_wild) or Talent(bloodtalons_talent) and Spell(healing_touch) or Spell(cat_form) or BuffExpires(stealthed_buff any=1) and Spell(prowl)
 	{
+		#snapshot_stats
 		#potion,name=draenic_agility
 		UsePotionAgility()
 	}
@@ -283,11 +246,10 @@ AddFunction FeralPrecombatCdActions
 #	spec=guardian
 #	talents=0301022

-# ActionList: GuardianDefaultActions --> main, shortcd, cd
+### actions.default --> main, shortcd, cd

-AddFunction GuardianDefaultActions
+AddFunction GuardianDefaultMainActions
 {
-	#auto_attack
 	#cenarion_ward
 	Spell(cenarion_ward)
 	#rejuvenation,if=buff.heart_of_the_wild.up&remains<=3.6
@@ -322,6 +284,7 @@ AddFunction GuardianDefaultShortCdActions

 AddFunction GuardianDefaultCdActions
 {
+	#auto_attack
 	#skull_bash
 	InterruptActions()
 	#blood_fury
@@ -351,9 +314,7 @@ AddFunction GuardianDefaultCdActions
 			#natures_vigil
 			Spell(natures_vigil)

-			unless BuffPresent(dream_of_cenarius_tank_buff) and HealthPercent() < 30 and Spell(healing_touch)
-				or BuffRemaining(pulverize_buff) < 0.5 and target.DebuffStacks(lacerate_debuff) >= 3 and Spell(pulverize)
-				or BuffRemaining(pulverize_buff) <= 3.6 and target.DebuffStacks(lacerate_debuff) >= 3 and Spell(pulverize)
+			unless BuffPresent(dream_of_cenarius_tank_buff) and HealthPercent() < 30 and Spell(healing_touch) or BuffRemaining(pulverize_buff) <= 3.6 and target.DebuffStacks(lacerate_debuff) >= 3 and Spell(pulverize) or Talent(pulverize_talent) and BuffRemaining(pulverize_buff) <= { 3 - target.DebuffStacks(lacerate_debuff) } * GCD() and BuffExpires(berserk_bear_buff) and Spell(lacerate)
 			{
 				#incarnation
 				Spell(incarnation_tank)
@@ -362,9 +323,9 @@ AddFunction GuardianDefaultCdActions
 	}
 }

-# ActionList: GuardianPrecombatActions --> main, shortcd, cd
+### actions.precombat --> main

-AddFunction GuardianPrecombatActions
+AddFunction GuardianPrecombatMainActions
 {
 	#flask,type=greater_draenic_agility_flask
 	#food,type=sleeper_surprise
@@ -377,10 +338,6 @@ AddFunction GuardianPrecombatActions
 	Spell(cenarion_ward)
 }

-AddFunction GuardianPrecombatShortCdActions {}
-
-AddFunction GuardianPrecombatCdActions {}
-
 ###
 ### Restoration
 ###
@@ -457,48 +414,40 @@ do
 # Druid rotation functions.
 Include(ovale_druid)

-### Feral Icons
+### Feral icons.
 AddCheckBox(opt_druid_feral_aoe L(AOE) specialization=feral default)

 AddIcon specialization=feral help=shortcd enemies=1 checkbox=!opt_druid_feral_aoe
 {
-	if InCombat(no) FeralPrecombatShortCdActions()
 	FeralDefaultShortCdActions()
 }

 AddIcon specialization=feral help=shortcd checkbox=opt_druid_feral_aoe
 {
-	if InCombat(no) FeralPrecombatShortCdActions()
 	FeralDefaultShortCdActions()
 }

 AddIcon specialization=feral help=main enemies=1
 {
-	if InCombat(no) FeralPrecombatActions()
-	FeralDefaultActions()
-}
-
-AddIcon specialization=feral help=predict enemies=1 checkbox=!opt_druid_feral_aoe
-{
-	if InCombat(no) FeralPrecombatPredictActions()
-	FeralDefaultPredictActions()
+	if not InCombat() FeralPrecombatMainActions()
+	FeralDefaultMainActions()
 }

 AddIcon specialization=feral help=aoe checkbox=opt_druid_feral_aoe
 {
-	if InCombat(no) FeralPrecombatActions()
-	FeralDefaultActions()
+	if not InCombat() FeralPrecombatMainActions()
+	FeralDefaultMainActions()
 }

 AddIcon specialization=feral help=cd enemies=1 checkbox=!opt_druid_feral_aoe
 {
-	if InCombat(no) FeralPrecombatCdActions()
+	if not InCombat() FeralPrecombatCdActions()
 	FeralDefaultCdActions()
 }

 AddIcon specialization=feral help=cd checkbox=opt_druid_feral_aoe
 {
-	if InCombat(no) FeralPrecombatCdActions()
+	if not InCombat() FeralPrecombatCdActions()
 	FeralDefaultCdActions()
 }

@@ -507,37 +456,33 @@ AddCheckBox(opt_druid_guardian_aoe L(AOE) specialization=guardian default)

 AddIcon specialization=guardian help=shortcd enemies=1 checkbox=!opt_druid_guardian_aoe
 {
-	if InCombat(no) GuardianPrecombatShortCdActions()
 	GuardianDefaultShortCdActions()
 }

 AddIcon specialization=guardian help=shortcd checkbox=opt_druid_guardian_aoe
 {
-	if InCombat(no) GuardianPrecombatShortCdActions()
 	GuardianDefaultShortCdActions()
 }

 AddIcon specialization=guardian help=main enemies=1
 {
-	if InCombat(no) GuardianPrecombatActions()
-	GuardianDefaultActions()
+	if not InCombat() GuardianPrecombatMainActions()
+	GuardianDefaultMainActions()
 }

 AddIcon specialization=guardian help=aoe checkbox=opt_druid_guardian_aoe
 {
-	if InCombat(no) GuardianPrecombatActions()
-	GuardianDefaultActions()
+	if not InCombat() GuardianPrecombatMainActions()
+	GuardianDefaultMainActions()
 }

 AddIcon specialization=guardian help=cd enemies=1 checkbox=!opt_druid_guardian_aoe
 {
-	if InCombat(no) GuardianPrecombatCdActions()
 	GuardianDefaultCdActions()
 }

 AddIcon specialization=guardian help=cd checkbox=opt_druid_guardian_aoe
 {
-	if InCombat(no) GuardianPrecombatCdActions()
 	GuardianDefaultCdActions()
 }

diff --git a/scripts/ovale_hunter.lua b/scripts/ovale_hunter.lua
index 26dc911..3644893 100644
--- a/scripts/ovale_hunter.lua
+++ b/scripts/ovale_hunter.lua
@@ -62,11 +62,10 @@ AddFunction SummonPet
 #	spec=beast_mastery
 #	talents=0002133

-# ActionList: BeastMasteryDefaultActions --> main, shortcd, cd
+### actions.default --> main, shortcd, cd

-AddFunction BeastMasteryDefaultActions
+AddFunction BeastMasteryDefaultMainActions
 {
-	#auto_shot
 	#multishot,if=active_enemies>5|(active_enemies>1&pet.cat.buff.beast_cleave.down)
 	if Enemies() > 5 or Enemies() > 1 and pet.BuffExpires(pet_beast_cleave_buff any=1) Spell(multishot)
 	#kill_shot,if=focus.time_to_max>gcd
@@ -97,10 +96,10 @@ AddFunction BeastMasteryDefaultShortCdActions
 	if Enemies() > 1 and CheckBoxOn(opt_trap_launcher) and not Glyph(glyph_of_explosive_trap) Spell(explosive_trap)
 	#bestial_wrath,if=focus>60&!buff.bestial_wrath.up
 	if Focus() > 60 and not BuffPresent(bestial_wrath_buff) Spell(bestial_wrath)
-	#barrage,if=active_enemies>2
-	if Enemies() > 2 Spell(barrage)
+	#barrage,if=active_enemies>1
+	if Enemies() > 1 Spell(barrage)

-	unless Enemies() > 5 or Enemies() > 1 and pet.BuffExpires(pet_beast_cleave_buff any=1) and Spell(multishot)
+	unless { Enemies() > 5 or Enemies() > 1 and pet.BuffExpires(pet_beast_cleave_buff any=1) } and Spell(multishot)
 	{
 		#focus_fire,five_stacks=1
 		if BuffStacks(frenzy_buff any=1) == 5 Spell(focus_fire)
@@ -109,11 +108,7 @@ AddFunction BeastMasteryDefaultShortCdActions
 		#a_murder_of_crows
 		Spell(a_murder_of_crows)

-		unless TimeToMaxFocus() > GCD() and Spell(kill_shot)
-			or pet.Present() and not pet.IsIncapacitated() and not pet.IsFeared() and not pet.IsStunned() and Spell(kill_command)
-			or Focus() < 50 and Spell(focusing_shot)
-			or BuffPresent(pre_steady_focus_buff) and 14 + FocusCastingRegen(cobra_shot) <= FocusDeficit() and Spell(cobra_shot)
-			or Spell(glaive_toss)
+		unless TimeToMaxFocus() > GCD() and Spell(kill_shot) or pet.Present() and not pet.IsIncapacitated() and not pet.IsFeared() and not pet.IsStunned() and Spell(kill_command) or Focus() < 50 and Spell(focusing_shot) or BuffPresent(pre_steady_focus_buff) and 14 + FocusCastingRegen(cobra_shot) <= FocusDeficit() and Spell(cobra_shot) or Spell(glaive_toss)
 		{
 			#barrage
 			Spell(barrage)
@@ -127,6 +122,7 @@ AddFunction BeastMasteryDefaultCdActions
 {
 	# CHANGE: Add interrupt actions missing from SimulationCraft action list.
 	InterruptActions()
+	#auto_shot
 	#arcane_torrent,if=focus.deficit>=30
 	if FocusDeficit() >= 30 Spell(arcane_torrent_focus)
 	#blood_fury
@@ -141,30 +137,32 @@ AddFunction BeastMasteryDefaultCdActions
 	if BuffPresent(burst_haste_buff any=1) or BuffPresent(focus_fire_buff) or target.TimeToDie() <= 25 Spell(stampede)
 }

-# ActionList: BeastMasteryPrecombatActions --> main, shortcd, cd
+### actions.precombat --> main, shortcd, cd

-AddFunction BeastMasteryPrecombatActions
+AddFunction BeastMasteryPrecombatMainActions
 {
-	#flask,type=greater_draenic_agility_flask
-	#food,type=blackrock_barbecue
 	#snapshot_stats
 	#exotic_munitions,ammo_type=poisoned,if=active_enemies<3
 	if Enemies() < 3 and BuffRemaining(exotic_munitions_buff) < 1200 Spell(poisoned_ammo)
 	#exotic_munitions,ammo_type=incendiary,if=active_enemies>=3
 	if Enemies() >= 3 and BuffRemaining(exotic_munitions_buff) < 1200 Spell(incendiary_ammo)
+	#glaive_toss
+	Spell(glaive_toss)
+	#focusing_shot,if=!talent.glaive_toss.enabled
+	if not Talent(glaive_toss_talent) Spell(focusing_shot)
 }

 AddFunction BeastMasteryPrecombatShortCdActions
 {
+	#flask,type=greater_draenic_agility_flask
+	#food,type=calamari_crepes
 	#summon_pet
 	BeastMasterySummonPet()
 }

 AddFunction BeastMasteryPrecombatCdActions
 {
-	unless not pet.Present() or pet.IsDead()
-		or Enemies() < 3 and BuffRemaining(exotic_munitions_buff) < 1200 and Spell(poisoned_ammo)
-		or Enemies() >= 3 and BuffRemaining(exotic_munitions_buff) < 1200 and Spell(incendiary_ammo)
+	unless Enemies() < 3 and BuffRemaining(exotic_munitions_buff) < 1200 and Spell(poisoned_ammo) or Enemies() >= 3 and BuffRemaining(exotic_munitions_buff) < 1200 and Spell(incendiary_ammo)
 	{
 		#potion,name=draenic_agility
 		UsePotionAgility()
@@ -179,17 +177,16 @@ AddFunction BeastMasteryPrecombatCdActions
 #	spec=marksmanship
 #	talents=0003113

-# ActionList: MarksmanshipDefaultActions --> main, shortcd, cd
+### actions.default --> main, shortcd, cd

-AddFunction MarksmanshipDefaultActions
+AddFunction MarksmanshipDefaultMainActions
 {
-	#auto_shot
 	#chimaera_shot
 	Spell(chimaera_shot)
 	#kill_shot
 	Spell(kill_shot)
 	#call_action_list,name=careful_aim,if=buff.careful_aim.up
-	if target.HealthPercent() > 80 or BuffPresent(rapid_fire_buff) MarksmanshipCarefulAimActions()
+	if target.HealthPercent() > 80 or BuffPresent(rapid_fire_buff) MarksmanshipCarefulAimMainActions()
 	#glaive_toss
 	Spell(glaive_toss)
 	#steady_shot,if=focus.deficit*cast_time%(14+cast_regen)>cooldown.rapid_fire.remains
@@ -214,8 +211,7 @@ AddFunction MarksmanshipDefaultActions

 AddFunction MarksmanshipDefaultShortCdActions
 {
-	unless Spell(chimaera_shot)
-		or Spell(kill_shot)
+	unless Spell(chimaera_shot) or Spell(kill_shot)
 	{
 		#call_action_list,name=careful_aim,if=buff.careful_aim.up
 		if target.HealthPercent() > 80 or BuffPresent(rapid_fire_buff) MarksmanshipCarefulAimShortCdActions()
@@ -240,6 +236,7 @@ AddFunction MarksmanshipDefaultCdActions
 {
 	# CHANGE: Add interrupt actions missing from SimulationCraft action list.
 	InterruptActions()
+	#auto_shot
 	#use_item,name=beating_heart_of_the_mountain
 	UseItemActions()
 	#arcane_torrent,if=focus.deficit>=30
@@ -251,21 +248,18 @@ AddFunction MarksmanshipDefaultCdActions
 	#potion,name=draenic_agility,if=((buff.rapid_fire.up|buff.bloodlust.up)&(cooldown.stampede.remains<1))|target.time_to_die<=25
 	if { BuffPresent(rapid_fire_buff) or BuffPresent(burst_haste_buff any=1) } and SpellCooldown(stampede) < 1 or target.TimeToDie() <= 25 UsePotionAgility()

-	unless FocusCastingRegen(kill_shot) + FocusCastingRegen(aimed_shot) < FocusDeficit() and Spell(kill_shot)
-		or Spell(chimaera_shot)
+	unless Spell(chimaera_shot) or Spell(kill_shot)
 	{
 		#rapid_fire
 		Spell(rapid_fire)
 		#stampede,if=buff.rapid_fire.up|buff.bloodlust.up|target.time_to_die<=25
 		if BuffPresent(rapid_fire_buff) or BuffPresent(burst_haste_buff any=1) or target.TimeToDie() <= 25 Spell(stampede)
-		#call_action_list,name=careful_aim,if=buff.careful_aim.up
-		if target.HealthPercent() > 80 or BuffPresent(rapid_fire_buff) MarksmanshipCarefulAimCdActions()
 	}
 }

-# ActionList: MarksmanshipCarefulAimActions --> main, shortcd, cd
+### actions.careful_aim --> main, shortcd

-AddFunction MarksmanshipCarefulAimActions
+AddFunction MarksmanshipCarefulAimMainActions
 {
 	#glaive_toss,if=active_enemies>2
 	if Enemies() > 2 Spell(glaive_toss)
@@ -288,34 +282,32 @@ AddFunction MarksmanshipCarefulAimShortCdActions
 	}
 }

-AddFunction MarksmanshipCarefulAimCdActions {}
+### actions.precombat --> main, shortcd, cd

-# ActionList: MarksmanshipPrecombatActions --> main, shortcd, cd
-
-AddFunction MarksmanshipPrecombatActions
+AddFunction MarksmanshipPrecombatMainActions
 {
-	#flask,type=greater_draenic_agility_flask
-	#food,type=blackrock_barbecue
 	#snapshot_stats
 	#exotic_munitions,ammo_type=poisoned,if=active_enemies<3
 	if Enemies() < 3 and BuffRemaining(exotic_munitions_buff) < 1200 Spell(poisoned_ammo)
 	#exotic_munitions,ammo_type=incendiary,if=active_enemies>=3
 	if Enemies() >= 3 and BuffRemaining(exotic_munitions_buff) < 1200 Spell(incendiary_ammo)
-	#aimed_shot
-	Spell(aimed_shot)
+	#glaive_toss
+	Spell(glaive_toss)
+	#focusing_shot,if=!talent.glaive_toss.enabled
+	if not Talent(glaive_toss_talent) Spell(focusing_shot_marksmanship)
 }

 AddFunction MarksmanshipPrecombatShortCdActions
 {
+	#flask,type=greater_draenic_agility_flask
+	#food,type=calamari_crepes
 	#summon_pet
 	SummonPet()
 }

 AddFunction MarksmanshipPrecombatCdActions
 {
-	unless not pet.Present() or pet.IsDead()
-		or Enemies() < 3 and BuffRemaining(exotic_munitions_buff) < 1200 and Spell(poisoned_ammo)
-		or Enemies() >= 3 and BuffRemaining(exotic_munitions_buff) < 1200 and Spell(incendiary_ammo)
+	unless Enemies() < 3 and BuffRemaining(exotic_munitions_buff) < 1200 and Spell(poisoned_ammo) or Enemies() >= 3 and BuffRemaining(exotic_munitions_buff) < 1200 and Spell(incendiary_ammo)
 	{
 		#potion,name=draenic_agility
 		UsePotionAgility()
@@ -328,23 +320,18 @@ AddFunction MarksmanshipPrecombatCdActions
 # Based on SimulationCraft profile "Hunter_SV_T17M".
 #	class=hunter
 #	spec=survival
-#	talents=0003123
+#	talents=0001112

-# ActionList: SurvivalDefaultActions --> main, shortcd, cd
+### actions.default --> main, shortcd, cd

-AddFunction SurvivalDefaultActions
+AddFunction SurvivalDefaultMainActions
 {
-	#auto_shot
 	#call_action_list,name=aoe,if=active_enemies>1
-	if Enemies() > 1 SurvivalAoeActions()
-	#black_arrow,if=!ticking
-	if not target.DebuffPresent(black_arrow_debuff) Spell(black_arrow)
+	if Enemies() > 1 SurvivalAoeMainActions()
 	#explosive_shot
 	Spell(explosive_shot)
 	#arcane_shot,if=buff.thrill_of_the_hunt.react&focus>35&cast_regen<=focus.deficit|dot.serpent_sting.remains<=3|target.time_to_die<4.5
 	if BuffPresent(thrill_of_the_hunt_buff) and Focus() > 35 and FocusCastingRegen(arcane_shot) <= FocusDeficit() or target.DebuffRemaining(serpent_sting_debuff) <= 3 or target.TimeToDie() < 4.5 Spell(arcane_shot)
-	#glaive_toss
-	Spell(glaive_toss)
 	#cobra_shot,if=buff.pre_steady_focus.up&buff.steady_focus.remains<5&(14+cast_regen)<=focus.deficit<80
 	if BuffPresent(pre_steady_focus_buff) and BuffRemaining(steady_focus_buff) < 5 and 14 + FocusCastingRegen(cobra_shot) <= FocusDeficit() < 80 Spell(cobra_shot)
 	#arcane_shot,if=focus>=80|talent.focusing_shot.enabled
@@ -359,22 +346,20 @@ AddFunction SurvivalDefaultShortCdActions
 {
 	#call_action_list,name=aoe,if=active_enemies>1
 	if Enemies() > 1 SurvivalAoeShortCdActions()
+	#a_murder_of_crows
+	Spell(a_murder_of_crows)
+	#black_arrow,if=!ticking
+	if not target.DebuffPresent(black_arrow_debuff) Spell(black_arrow)

-	unless not target.DebuffPresent(black_arrow_debuff) and Spell(black_arrow)
-		or Spell(explosive_shot)
+	unless Spell(explosive_shot)
 	{
-		#a_murder_of_crows
-		Spell(a_murder_of_crows)
 		#dire_beast
 		Spell(dire_beast)

-		unless { BuffPresent(thrill_of_the_hunt_buff) and Focus() > 35 and FocusCastingRegen(arcane_shot) <= FocusDeficit() or target.DebuffRemaining(serpent_sting_debuff) <= 5 or target.TimeToDie() < 4.5 } and Spell(arcane_shot)
-			or Spell(glaive_toss)
+		unless { BuffPresent(thrill_of_the_hunt_buff) and Focus() > 35 and FocusCastingRegen(arcane_shot) <= FocusDeficit() or target.DebuffRemaining(serpent_sting_debuff) <= 3 or target.TimeToDie() < 4.5 } and Spell(arcane_shot)
 		{
-			#powershot
-			Spell(powershot)
-			#barrage
-			Spell(barrage)
+			#explosive_trap
+			if CheckBoxOn(opt_trap_launcher) and not Glyph(glyph_of_explosive_trap) Spell(explosive_trap)
 		}
 	}
 }
@@ -397,17 +382,15 @@ AddFunction SurvivalDefaultCdActions
 	#call_action_list,name=aoe,if=active_enemies>1
 	if Enemies() > 1 SurvivalAoeCdActions()
 	#stampede,if=buff.potion.up|(cooldown.potion.remains&(buff.archmages_greater_incandescence_agi.up|trinket.stat.any.up))|target.time_to_die<=25
-	if BuffPresent(potion_agility_buff) or ItemCooldown(virmens_bite_potion) > 0 and { BuffPresent(archmages_greater_incandescence_agi_buff) or BuffPresent(trinket_stat_any_buff) } or target.TimeToDie() <= 25 Spell(stampede)
+	if BuffPresent(potion_agility_buff) or ItemCooldown(draenic_agility_potion) > 0 and { BuffPresent(archmages_greater_incandescence_agi_buff) or BuffPresent(trinket_stat_any_buff) } or target.TimeToDie() <= 25 Spell(stampede)
 }

-# ActionList: SurvivalAoeActions --> main, shortcd, cd
+### actions.aoe --> main, shortcd, cd

-AddFunction SurvivalAoeActions
+AddFunction SurvivalAoeMainActions
 {
 	#explosive_shot,if=buff.lock_and_load.react&(!talent.barrage.enabled|cooldown.barrage.remains>0)
 	if BuffPresent(lock_and_load_buff) and { not Talent(barrage_talent) or SpellCooldown(barrage) > 0 } Spell(explosive_shot)
-	#black_arrow,if=!ticking
-	if not target.DebuffPresent(black_arrow_debuff) Spell(black_arrow)
 	#explosive_shot,if=active_enemies<5
 	if Enemies() < 5 Spell(explosive_shot)
 	#multishot,if=buff.thrill_of_the_hunt.react&focus>50&cast_regen<=focus.deficit|dot.serpent_sting.remains<=5|target.time_to_die<4.5
@@ -430,9 +413,10 @@ AddFunction SurvivalAoeShortCdActions
 	{
 		#barrage
 		Spell(barrage)
+		#black_arrow,if=!ticking
+		if not target.DebuffPresent(black_arrow_debuff) Spell(black_arrow)

-		unless not target.DebuffPresent(black_arrow_debuff) and Spell(black_arrow)
-			or Enemies() < 5 and Spell(explosive_shot)
+		unless Enemies() < 5 and Spell(explosive_shot)
 		{
 			#explosive_trap,if=dot.explosive_trap.remains<=5
 			if target.DebuffRemaining(explosive_trap_debuff) <= 5 and CheckBoxOn(opt_trap_launcher) and not Glyph(glyph_of_explosive_trap) Spell(explosive_trap)
@@ -441,8 +425,7 @@ AddFunction SurvivalAoeShortCdActions
 			#dire_beast
 			Spell(dire_beast)

-			unless { BuffPresent(thrill_of_the_hunt_buff) and Focus() > 50 and FocusCastingRegen(multishot) <= FocusDeficit() or target.DebuffRemaining(serpent_sting_debuff) <= 5 or target.TimeToDie() < 4.5 } and Spell(multishot)
-				or Spell(glaive_toss)
+			unless { BuffPresent(thrill_of_the_hunt_buff) and Focus() > 50 and FocusCastingRegen(multishot) <= FocusDeficit() or target.DebuffRemaining(serpent_sting_debuff) <= 5 or target.TimeToDie() < 4.5 } and Spell(multishot) or Spell(glaive_toss)
 			{
 				#powershot
 				Spell(powershot)
@@ -457,30 +440,32 @@ AddFunction SurvivalAoeCdActions
 	if BuffPresent(potion_agility_buff) or ItemCooldown(draenic_agility_potion) > 0 and { BuffPresent(archmages_greater_incandescence_agi_buff) or BuffPresent(trinket_stat_any_buff) or BuffPresent(archmages_incandescence_agi_buff) } Spell(stampede)
 }

-# ActionList: SurvivalPrecombatActions --> main, shortcd, cd
+### actions.precombat --> main, shortcd, cd

-AddFunction SurvivalPrecombatActions
+AddFunction SurvivalPrecombatMainActions
 {
-	#flask,type=greater_draenic_agility_flask
-	#food,type=blackrock_barbecue
 	#snapshot_stats
 	#exotic_munitions,ammo_type=poisoned,if=active_enemies<3
 	if Enemies() < 3 and BuffRemaining(exotic_munitions_buff) < 1200 Spell(poisoned_ammo)
 	#exotic_munitions,ammo_type=incendiary,if=active_enemies>=3
 	if Enemies() >= 3 and BuffRemaining(exotic_munitions_buff) < 1200 Spell(incendiary_ammo)
+	#glaive_toss
+	Spell(glaive_toss)
+	#focusing_shot,if=!talent.glaive_toss.enabled
+	if not Talent(glaive_toss_talent) Spell(focusing_shot)
 }

 AddFunction SurvivalPrecombatShortCdActions
 {
+	#flask,type=greater_draenic_agility_flask
+	#food,type=calamari_crepes
 	#summon_pet
 	SummonPet()
 }

 AddFunction SurvivalPrecombatCdActions
 {
-	unless not pet.Present() or pet.IsDead()
-		or Enemies() < 3 and BuffRemaining(exotic_munitions_buff) < 1200 and Spell(poisoned_ammo)
-		or Enemies() >= 3 and BuffRemaining(exotic_munitions_buff) < 1200 and Spell(incendiary_ammo)
+	unless Enemies() < 3 and BuffRemaining(exotic_munitions_buff) < 1200 and Spell(poisoned_ammo) or Enemies() >= 3 and BuffRemaining(exotic_munitions_buff) < 1200 and Spell(incendiary_ammo)
 	{
 		#potion,name=draenic_agility
 		UsePotionAgility()
@@ -499,120 +484,120 @@ do
 # Hunter rotation functions.
 Include(ovale_hunter)

-### Beast Mastery icons
+### BeastMastery icons.
 AddCheckBox(opt_hunter_beast_mastery_aoe L(AOE) specialization=beast_mastery default)

 AddIcon specialization=beast_mastery help=shortcd enemies=1 checkbox=!opt_hunter_beast_mastery_aoe
 {
-	if InCombat(no) BeastMasteryPrecombatShortCdActions()
+	if not InCombat() BeastMasteryPrecombatShortCdActions()
 	BeastMasteryDefaultShortCdActions()
 }

 AddIcon specialization=beast_mastery help=shortcd checkbox=opt_hunter_beast_mastery_aoe
 {
-	if InCombat(no) BeastMasteryPrecombatShortCdActions()
+	if not InCombat() BeastMasteryPrecombatShortCdActions()
 	BeastMasteryDefaultShortCdActions()
 }

 AddIcon specialization=beast_mastery help=main enemies=1
 {
-	if InCombat(no) BeastMasteryPrecombatActions()
-	BeastMasteryDefaultActions()
+	if not InCombat() BeastMasteryPrecombatMainActions()
+	BeastMasteryDefaultMainActions()
 }

 AddIcon specialization=beast_mastery help=aoe checkbox=opt_hunter_beast_mastery_aoe
 {
-	if InCombat(no) BeastMasteryPrecombatActions()
-	BeastMasteryDefaultActions()
+	if not InCombat() BeastMasteryPrecombatMainActions()
+	BeastMasteryDefaultMainActions()
 }

 AddIcon specialization=beast_mastery help=cd enemies=1 checkbox=!opt_hunter_beast_mastery_aoe
 {
-	if InCombat(no) BeastMasteryPrecombatCdActions()
+	if not InCombat() BeastMasteryPrecombatCdActions()
 	BeastMasteryDefaultCdActions()
 }

 AddIcon specialization=beast_mastery help=cd checkbox=opt_hunter_beast_mastery_aoe
 {
-	if InCombat(no) BeastMasteryPrecombatCdActions()
+	if not InCombat() BeastMasteryPrecombatCdActions()
 	BeastMasteryDefaultCdActions()
 }

-### Marksmanship icons
+### Marksmanship icons.
 AddCheckBox(opt_hunter_marksmanship_aoe L(AOE) specialization=marksmanship default)

 AddIcon specialization=marksmanship help=shortcd enemies=1 checkbox=!opt_hunter_marksmanship_aoe
 {
-	if InCombat(no) MarksmanshipPrecombatShortCdActions()
+	if not InCombat() MarksmanshipPrecombatShortCdActions()
 	MarksmanshipDefaultShortCdActions()
 }

 AddIcon specialization=marksmanship help=shortcd checkbox=opt_hunter_marksmanship_aoe
 {
-	if InCombat(no) MarksmanshipPrecombatShortCdActions()
+	if not InCombat() MarksmanshipPrecombatShortCdActions()
 	MarksmanshipDefaultShortCdActions()
 }

 AddIcon specialization=marksmanship help=main enemies=1
 {
-	if InCombat(no) MarksmanshipPrecombatActions()
-	MarksmanshipDefaultActions()
+	if not InCombat() MarksmanshipPrecombatMainActions()
+	MarksmanshipDefaultMainActions()
 }

 AddIcon specialization=marksmanship help=aoe checkbox=opt_hunter_marksmanship_aoe
 {
-	if InCombat(no) MarksmanshipPrecombatActions()
-	MarksmanshipDefaultActions()
+	if not InCombat() MarksmanshipPrecombatMainActions()
+	MarksmanshipDefaultMainActions()
 }

 AddIcon specialization=marksmanship help=cd enemies=1 checkbox=!opt_hunter_marksmanship_aoe
 {
-	if InCombat(no) MarksmanshipPrecombatCdActions()
+	if not InCombat() MarksmanshipPrecombatCdActions()
 	MarksmanshipDefaultCdActions()
 }

 AddIcon specialization=marksmanship help=cd checkbox=opt_hunter_marksmanship_aoe
 {
-	if InCombat(no) MarksmanshipPrecombatCdActions()
+	if not InCombat() MarksmanshipPrecombatCdActions()
 	MarksmanshipDefaultCdActions()
 }

-### Survival icons
+### Survival icons.
 AddCheckBox(opt_hunter_survival_aoe L(AOE) specialization=survival default)

 AddIcon specialization=survival help=shortcd enemies=1 checkbox=!opt_hunter_survival_aoe
 {
-	if InCombat(no) SurvivalPrecombatShortCdActions()
+	if not InCombat() SurvivalPrecombatShortCdActions()
 	SurvivalDefaultShortCdActions()
 }

 AddIcon specialization=survival help=shortcd checkbox=opt_hunter_survival_aoe
 {
-	if InCombat(no) SurvivalPrecombatShortCdActions()
+	if not InCombat() SurvivalPrecombatShortCdActions()
 	SurvivalDefaultShortCdActions()
 }

 AddIcon specialization=survival help=main enemies=1
 {
-	if InCombat(no) SurvivalPrecombatActions()
-	SurvivalDefaultActions()
+	if not InCombat() SurvivalPrecombatMainActions()
+	SurvivalDefaultMainActions()
 }

 AddIcon specialization=survival help=aoe checkbox=opt_hunter_survival_aoe
 {
-	if InCombat(no) SurvivalPrecombatActions()
-	SurvivalDefaultActions()
+	if not InCombat() SurvivalPrecombatMainActions()
+	SurvivalDefaultMainActions()
 }

 AddIcon specialization=survival help=cd enemies=1 checkbox=!opt_hunter_survival_aoe
 {
-	if InCombat(no) SurvivalPrecombatCdActions()
+	if not InCombat() SurvivalPrecombatCdActions()
 	SurvivalDefaultCdActions()
 }

 AddIcon specialization=survival help=cd checkbox=opt_hunter_survival_aoe
 {
-	if InCombat(no) SurvivalPrecombatCdActions()
+	if not InCombat() SurvivalPrecombatCdActions()
 	SurvivalDefaultCdActions()
 }
 ]]
diff --git a/scripts/ovale_mage.lua b/scripts/ovale_mage.lua
index 3ede80b..ff77d01 100644
--- a/scripts/ovale_mage.lua
+++ b/scripts/ovale_mage.lua
@@ -37,27 +37,31 @@ AddFunction InterruptActions
 # Based on SimulationCraft profile "Mage_Arcane_T17M".
 #	class=mage
 #	spec=arcane
-#	talents=3003121
+#	talents=3003123
 #	glyphs=arcane_power/cone_of_cold

-# ActionList: ArcaneDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction ArcaneDefaultActions
+AddFunction ArcaneDefaultMainActions
 {
 	#call_action_list,name=init_crystal,if=talent.prismatic_crystal.enabled&cooldown.prismatic_crystal.up
-	if Talent(prismatic_crystal_talent) and not SpellCooldown(prismatic_crystal) > 0 ArcaneInitCrystalActions()
+	if Talent(prismatic_crystal_talent) and not SpellCooldown(prismatic_crystal) > 0 ArcaneInitCrystalMainActions()
 	#call_action_list,name=crystal_sequence,if=talent.prismatic_crystal.enabled&pet.prismatic_crystal.active
-	if Talent(prismatic_crystal_talent) and TotemPresent(prismatic_crystal) ArcaneCrystalSequenceActions()
+	if Talent(prismatic_crystal_talent) and TotemPresent(prismatic_crystal) ArcaneCrystalSequenceMainActions()
 	#call_action_list,name=aoe,if=active_enemies>=4
-	if Enemies() >= 4 ArcaneAoeActions()
+	if Enemies() >= 4 ArcaneAoeMainActions()
 	#call_action_list,name=burn,if=time_to_die<mana.pct*0.35*spell_haste|cooldown.evocation.remains<=(mana.pct-30)*0.3*spell_haste|(buff.arcane_power.up&cooldown.evocation.remains<=(mana.pct-30)*0.4*spell_haste)
-	if TimeToDie() < ManaPercent() * 0.35 * 100 / { 100 + SpellHaste() } or SpellCooldown(evocation) <= { ManaPercent() - 30 } * 0.3 * 100 / { 100 + SpellHaste() } or BuffPresent(arcane_power_buff) and SpellCooldown(evocation) <= { ManaPercent() - 30 } * 0.4 * 100 / { 100 + SpellHaste() } ArcaneBurnActions()
+	if TimeToDie() < ManaPercent() * 0.35 * 100 / { 100 + SpellHaste() } or SpellCooldown(evocation) <= { ManaPercent() - 30 } * 0.3 * 100 / { 100 + SpellHaste() } or BuffPresent(arcane_power_buff) and SpellCooldown(evocation) <= { ManaPercent() - 30 } * 0.4 * 100 / { 100 + SpellHaste() } ArcaneBurnMainActions()
 	#call_action_list,name=conserve
-	ArcaneConserveActions()
+	ArcaneConserveMainActions()
 }

 AddFunction ArcaneDefaultShortCdActions
 {
+	#blink,if=movement.distance>10
+	if 0 > 10 Spell(blink)
+	#blazing_speed,if=movement.remains>0
+	if 0 > 0 Spell(blazing_speed)
 	#ice_floes,if=buff.ice_floes.down&(raid_event.movement.distance>0|raid_event.movement.in<action.arcane_missiles.cast_time)
 	if BuffExpires(ice_floes_buff) and { 0 > 0 or 600 < CastTime(arcane_missiles) } Spell(ice_floes)
 	#rune_of_power,if=buff.rune_of_power.remains<cast_time
@@ -78,34 +82,37 @@ AddFunction ArcaneDefaultCdActions
 {
 	#counterspell,if=target.debuff.casting.react
 	if target.IsInterruptible() InterruptActions()
-	#cold_snap,if=health.pct<30
-	if HealthPercent() < 30 Spell(cold_snap)
-	#time_warp,if=target.health.pct<25|time>5
-	if { target.HealthPercent() < 25 or TimeInCombat() > 5 } and CheckBoxOn(opt_time_warp) and DebuffExpires(burst_haste_debuff any=1) Spell(time_warp)

-	unless BuffExpires(ice_floes_buff) and { 0 > 0 or 600 < CastTime(arcane_missiles) } and Spell(ice_floes)
-		or TotemRemaining(rune_of_power) < CastTime(rune_of_power) and Spell(rune_of_power)
+	unless 0 > 10 and Spell(blink)
 	{
-		#mirror_image
-		Spell(mirror_image)
-		#cold_snap,if=buff.presence_of_mind.down&cooldown.presence_of_mind.remains>75
-		if BuffExpires(presence_of_mind_buff) and SpellCooldown(presence_of_mind) > 75 Spell(cold_snap)
-		#call_action_list,name=init_crystal,if=talent.prismatic_crystal.enabled&cooldown.prismatic_crystal.up
-		if Talent(prismatic_crystal_talent) and not SpellCooldown(prismatic_crystal) > 0 ArcaneInitCrystalCdActions()
-		#call_action_list,name=crystal_sequence,if=talent.prismatic_crystal.enabled&pet.prismatic_crystal.active
-		if Talent(prismatic_crystal_talent) and TotemPresent(prismatic_crystal) ArcaneCrystalSequenceCdActions()
-		#call_action_list,name=aoe,if=active_enemies>=4
-		if Enemies() >= 4 ArcaneAoeCdActions()
-		#call_action_list,name=burn,if=time_to_die<mana.pct*0.35*spell_haste|cooldown.evocation.remains<=(mana.pct-30)*0.3*spell_haste|(buff.arcane_power.up&cooldown.evocation.remains<=(mana.pct-30)*0.4*spell_haste)
-		if TimeToDie() < ManaPercent() * 0.35 * 100 / { 100 + SpellHaste() } or SpellCooldown(evocation) <= { ManaPercent() - 30 } * 0.3 * 100 / { 100 + SpellHaste() } or BuffPresent(arcane_power_buff) and SpellCooldown(evocation) <= { ManaPercent() - 30 } * 0.4 * 100 / { 100 + SpellHaste() } ArcaneBurnCdActions()
-		#call_action_list,name=conserve
-		ArcaneConserveCdActions()
+		#cold_snap,if=health.pct<30
+		if HealthPercent() < 30 Spell(cold_snap)
+		#time_warp,if=target.health.pct<25|time>5
+		if { target.HealthPercent() < 25 or TimeInCombat() > 5 } and CheckBoxOn(opt_time_warp) and DebuffExpires(burst_haste_debuff any=1) Spell(time_warp)
+
+		unless BuffExpires(ice_floes_buff) and { 0 > 0 or 600 < CastTime(arcane_missiles) } and Spell(ice_floes) or TotemRemaining(rune_of_power) < CastTime(rune_of_power) and Spell(rune_of_power)
+		{
+			#mirror_image
+			Spell(mirror_image)
+			#cold_snap,if=buff.presence_of_mind.down&cooldown.presence_of_mind.remains>75
+			if BuffExpires(presence_of_mind_buff) and SpellCooldown(presence_of_mind) > 75 Spell(cold_snap)
+			#call_action_list,name=init_crystal,if=talent.prismatic_crystal.enabled&cooldown.prismatic_crystal.up
+			if Talent(prismatic_crystal_talent) and not SpellCooldown(prismatic_crystal) > 0 ArcaneInitCrystalCdActions()
+			#call_action_list,name=crystal_sequence,if=talent.prismatic_crystal.enabled&pet.prismatic_crystal.active
+			if Talent(prismatic_crystal_talent) and TotemPresent(prismatic_crystal) ArcaneCrystalSequenceCdActions()
+			#call_action_list,name=aoe,if=active_enemies>=4
+			if Enemies() >= 4 ArcaneAoeCdActions()
+			#call_action_list,name=burn,if=time_to_die<mana.pct*0.35*spell_haste|cooldown.evocation.remains<=(mana.pct-30)*0.3*spell_haste|(buff.arcane_power.up&cooldown.evocation.remains<=(mana.pct-30)*0.4*spell_haste)
+			if TimeToDie() < ManaPercent() * 0.35 * 100 / { 100 + SpellHaste() } or SpellCooldown(evocation) <= { ManaPercent() - 30 } * 0.3 * 100 / { 100 + SpellHaste() } or BuffPresent(arcane_power_buff) and SpellCooldown(evocation) <= { ManaPercent() - 30 } * 0.4 * 100 / { 100 + SpellHaste() } ArcaneBurnCdActions()
+			#call_action_list,name=conserve
+			ArcaneConserveCdActions()
+		}
 	}
 }

-# ActionList: ArcaneAoeActions --> main, shortcd, cd
+### actions.aoe

-AddFunction ArcaneAoeActions
+AddFunction ArcaneAoeMainActions
 {
 	#nether_tempest,cycle_targets=1,if=buff.arcane_charge.stack=4&(active_dot.nether_tempest=0|(ticking&remains<3.6))
 	if DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < 3.6 } Spell(nether_tempest)
@@ -113,15 +120,23 @@ AddFunction ArcaneAoeActions
 	Spell(supernova)
 	#arcane_barrage,if=buff.arcane_charge.stack=4
 	if DebuffStacks(arcane_charge_debuff) == 4 Spell(arcane_barrage)
-	#arcane_orb,if=buff.arcane_charge.stack<4
-	if DebuffStacks(arcane_charge_debuff) < 4 Spell(arcane_orb)
 	#cone_of_cold,if=glyph.cone_of_cold.enabled
 	if Glyph(glyph_of_cone_of_cold) Spell(cone_of_cold)
 	#arcane_explosion
 	Spell(arcane_explosion)
 }

-AddFunction ArcaneAoeShortCdActions {}
+AddFunction ArcaneAoeShortCdActions
+{
+	#call_action_list,name=cooldowns
+	ArcaneCooldownsShortCdActions()
+
+	unless DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < 3.6 } and Spell(nether_tempest) or Spell(supernova) or DebuffStacks(arcane_charge_debuff) == 4 and Spell(arcane_barrage)
+	{
+		#arcane_orb,if=buff.arcane_charge.stack<4
+		if DebuffStacks(arcane_charge_debuff) < 4 Spell(arcane_orb)
+	}
+}

 AddFunction ArcaneAoeCdActions
 {
@@ -129,9 +144,9 @@ AddFunction ArcaneAoeCdActions
 	ArcaneCooldownsCdActions()
 }

-# ActionList: ArcaneBurnActions --> main, shortcd, cd
+### actions.burn

-AddFunction ArcaneBurnActions
+AddFunction ArcaneBurnMainActions
 {
 	#arcane_missiles,if=buff.arcane_missiles.react=3
 	if BuffStacks(arcane_missiles_buff) == 3 and BuffPresent(arcane_missiles_buff) Spell(arcane_missiles)
@@ -141,48 +156,36 @@ AddFunction ArcaneBurnActions
 	if TimeToDie() < 8 or Charges(supernova) == 2 Spell(supernova)
 	#nether_tempest,cycle_targets=1,if=target!=prismatic_crystal&buff.arcane_charge.stack=4&(active_dot.nether_tempest=0|(ticking&remains<3.6))
 	if not target.Name(prismatic_crystal) and DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < 3.6 } Spell(nether_tempest)
-	#arcane_orb,if=buff.arcane_charge.stack<4
-	if DebuffStacks(arcane_charge_debuff) < 4 Spell(arcane_orb)
-	#supernova,if=current_target=prismatic_crystal
-	if target.Name(prismatic_crystal) Spell(supernova)
 	#arcane_blast,if=buff.arcane_charge.stack=4&mana.pct>93
 	if DebuffStacks(arcane_charge_debuff) == 4 and ManaPercent() > 93 Spell(arcane_blast)
-	#arcane_missiles,if=buff.arcane_charge.stack=4
-	if DebuffStacks(arcane_charge_debuff) == 4 and BuffPresent(arcane_missiles_buff) Spell(arcane_missiles)
-	#supernova,if=mana.pct<96
-	if ManaPercent() < 96 Spell(supernova)
+	#arcane_missiles,if=buff.arcane_charge.stack=4&(mana.pct>70|!cooldown.evocation.up)
+	if DebuffStacks(arcane_charge_debuff) == 4 and { ManaPercent() > 70 or not { not SpellCooldown(evocation) > 0 } } and BuffPresent(arcane_missiles_buff) Spell(arcane_missiles)
+	#supernova,if=mana.pct>70&mana.pct<96
+	if ManaPercent() > 70 and ManaPercent() < 96 Spell(supernova)
 	#call_action_list,name=conserve,if=cooldown.evocation.duration-cooldown.evocation.remains<5
-	if SpellCooldownDuration(evocation) - SpellCooldown(evocation) < 5 ArcaneConserveActions()
+	if SpellCooldownDuration(evocation) - SpellCooldown(evocation) < 5 ArcaneConserveMainActions()
 	#arcane_blast
 	Spell(arcane_blast)
 }

 AddFunction ArcaneBurnShortCdActions
 {
-	unless BuffStacks(arcane_missiles_buff) == 3 and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles)
-		or ArmorSetBonus(T17 4) and BuffPresent(arcane_instability_buff) and BuffRemaining(arcane_instability_buff) < ExecuteTime(arcane_blast) and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles)
-		or { TimeToDie() < 8 or Charges(supernova) == 2 } and Spell(supernova)
-		or not target.Name(prismatic_crystal) and DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < 3.6 } and Spell(nether_tempest)
+	#call_action_list,name=cooldowns
+	ArcaneCooldownsShortCdActions()
+
+	unless BuffStacks(arcane_missiles_buff) == 3 and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles) or ArmorSetBonus(T17 4) and BuffPresent(arcane_instability_buff) and BuffRemaining(arcane_instability_buff) < ExecuteTime(arcane_blast) and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles) or { TimeToDie() < 8 or Charges(supernova) == 2 } and Spell(supernova) or not target.Name(prismatic_crystal) and DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < 3.6 } and Spell(nether_tempest)
 	{
 		#arcane_orb,if=buff.arcane_charge.stack<4
 		if DebuffStacks(arcane_charge_debuff) < 4 Spell(arcane_orb)
+		#presence_of_mind,if=mana.pct>96&(!talent.prismatic_crystal.enabled|!cooldown.prismatic_crystal.up)
+		if ManaPercent() > 96 and { not Talent(prismatic_crystal_talent) or not { not SpellCooldown(prismatic_crystal) > 0 } } Spell(presence_of_mind)

-		unless target.Name(prismatic_crystal) and Spell(supernova)
+		unless DebuffStacks(arcane_charge_debuff) == 4 and ManaPercent() > 93 and Spell(arcane_blast) or DebuffStacks(arcane_charge_debuff) == 4 and { ManaPercent() > 70 or not { not SpellCooldown(evocation) > 0 } } and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles) or ManaPercent() > 70 and ManaPercent() < 96 and Spell(supernova)
 		{
-			#presence_of_mind,if=mana.pct>96
-			if ManaPercent() > 96 Spell(presence_of_mind)
-
-			unless DebuffStacks(arcane_charge_debuff) == 4 and ManaPercent() > 93 and Spell(arcane_blast)
-				or DebuffStacks(arcane_charge_debuff) == 4 and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles)
-				or ManaPercent() < 96 and Spell(supernova)
-			{
-				#call_action_list,name=conserve,if=cooldown.evocation.duration-cooldown.evocation.remains<5
-				if SpellCooldownDuration(evocation) - SpellCooldown(evocation) < 5 ArcaneConserveShortCdActions()
-				#evocation,interrupt_if=mana.pct>92,if=time_to_die>10&mana.pct<50
-				if TimeToDie() > 10 and ManaPercent() < 50 Spell(evocation)
-				#presence_of_mind
-				Spell(presence_of_mind)
-			}
+			#call_action_list,name=conserve,if=cooldown.evocation.duration-cooldown.evocation.remains<5
+			if SpellCooldownDuration(evocation) - SpellCooldown(evocation) < 5 ArcaneConserveShortCdActions()
+			#presence_of_mind,if=!talent.prismatic_crystal.enabled|!cooldown.prismatic_crystal.up
+			if not Talent(prismatic_crystal_talent) or not { not SpellCooldown(prismatic_crystal) > 0 } Spell(presence_of_mind)
 		}
 	}
 }
@@ -192,24 +195,18 @@ AddFunction ArcaneBurnCdActions
 	#call_action_list,name=cooldowns
 	ArcaneCooldownsCdActions()

-	unless BuffStacks(arcane_missiles_buff) == 3 and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles)
-		or ArmorSetBonus(T17 4) and BuffPresent(arcane_instability_buff) and BuffRemaining(arcane_instability_buff) < ExecuteTime(arcane_blast) and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles)
-		or { TimeToDie() < 8 or Charges(supernova) == 2 } and Spell(supernova)
-		or not target.Name(prismatic_crystal) and DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < 3.6 } and Spell(nether_tempest)
-		or DebuffStacks(arcane_charge_debuff) < 4 and Spell(arcane_orb)
-		or target.Name(prismatic_crystal) and Spell(supernova)
-		or DebuffStacks(arcane_charge_debuff) == 4 and ManaPercent() > 93 and Spell(arcane_blast)
-		or DebuffStacks(arcane_charge_debuff) == 4 and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles)
-		or ManaPercent() < 96 and Spell(supernova)
+	unless BuffStacks(arcane_missiles_buff) == 3 and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles) or ArmorSetBonus(T17 4) and BuffPresent(arcane_instability_buff) and BuffRemaining(arcane_instability_buff) < ExecuteTime(arcane_blast) and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles) or { TimeToDie() < 8 or Charges(supernova) == 2 } and Spell(supernova) or not target.Name(prismatic_crystal) and DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < 3.6 } and Spell(nether_tempest) or DebuffStacks(arcane_charge_debuff) < 4 and Spell(arcane_orb) or DebuffStacks(arcane_charge_debuff) == 4 and ManaPercent() > 93 and Spell(arcane_blast) or DebuffStacks(arcane_charge_debuff) == 4 and { ManaPercent() > 70 or not { not SpellCooldown(evocation) > 0 } } and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles) or ManaPercent() > 70 and ManaPercent() < 96 and Spell(supernova)
 	{
 		#call_action_list,name=conserve,if=cooldown.evocation.duration-cooldown.evocation.remains<5
 		if SpellCooldownDuration(evocation) - SpellCooldown(evocation) < 5 ArcaneConserveCdActions()
+		#evocation,interrupt_if=mana.pct>92,if=time_to_die>10&mana.pct<50
+		if TimeToDie() > 10 and ManaPercent() < 50 Spell(evocation)
 	}
 }

-# ActionList: ArcaneConserveActions --> main, shortcd, cd
+### actions.conserve

-AddFunction ArcaneConserveActions
+AddFunction ArcaneConserveMainActions
 {
 	#arcane_missiles,if=buff.arcane_missiles.react=3|(talent.overpowered.enabled&buff.arcane_power.up&buff.arcane_power.remains<action.arcane_blast.execute_time)
 	if { BuffStacks(arcane_missiles_buff) == 3 or Talent(overpowered_talent) and BuffPresent(arcane_power_buff) and BuffRemaining(arcane_power_buff) < ExecuteTime(arcane_blast) } and BuffPresent(arcane_missiles_buff) Spell(arcane_missiles)
@@ -226,7 +223,7 @@ AddFunction ArcaneConserveActions
 	#supernova,if=mana.pct<96&(buff.arcane_missiles.stack<2|buff.arcane_charge.stack=4)&(buff.arcane_power.up|(charges=1&cooldown.arcane_power.remains>recharge_time))&(!talent.prismatic_crystal.enabled|current_target=prismatic_crystal|(charges=1&cooldown.prismatic_crystal.remains>recharge_time+8))
 	if ManaPercent() < 96 and { BuffStacks(arcane_missiles_buff) < 2 or DebuffStacks(arcane_charge_debuff) == 4 } and { BuffPresent(arcane_power_buff) or Charges(supernova) == 1 and SpellCooldown(arcane_power) > SpellChargeCooldown(supernova) } and { not Talent(prismatic_crystal_talent) or target.Name(prismatic_crystal) or Charges(supernova) == 1 and SpellCooldown(prismatic_crystal) > SpellChargeCooldown(supernova) + 8 } Spell(supernova)
 	#nether_tempest,cycle_targets=1,if=target!=prismatic_crystal&buff.arcane_charge.stack=4&(active_dot.nether_tempest=0|(ticking&remains<(10-3*talent.arcane_orb.enabled)*spell_haste))
-	if not target.Name(prismatic_crystal) and DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < { 10 - 3 * Talent(arcane_orb_talent) } * 100 / { 100 + SpellHaste() } } Spell(nether_tempest)
+	if not target.Name(prismatic_crystal) and DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < { 10 - 3 * TalentPoints(arcane_orb_talent) } * 100 / { 100 + SpellHaste() } } Spell(nether_tempest)
 	#arcane_barrage,if=buff.arcane_charge.stack=4
 	if DebuffStacks(arcane_charge_debuff) == 4 Spell(arcane_barrage)
 	#arcane_blast
@@ -237,24 +234,20 @@ AddFunction ArcaneConserveActions

 AddFunction ArcaneConserveShortCdActions
 {
-	unless { BuffStacks(arcane_missiles_buff) == 3 or Talent(overpowered_talent) and BuffPresent(arcane_power_buff) and BuffRemaining(arcane_power_buff) < ExecuteTime(arcane_blast) } and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles)
-		or ArmorSetBonus(T17 4) and BuffPresent(arcane_instability_buff) and BuffRemaining(arcane_instability_buff) < ExecuteTime(arcane_blast) and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles)
-		or not target.Name(prismatic_crystal) and DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < 3.6 } and Spell(nether_tempest)
-		or { TimeToDie() < 8 or Charges(supernova) == 2 and { BuffPresent(arcane_power_buff) or not { not SpellCooldown(arcane_power) > 0 } } and { not Talent(prismatic_crystal_talent) or SpellCooldown(prismatic_crystal) > 8 } } and Spell(supernova)
+	#call_action_list,name=cooldowns,if=time_to_die<30|(buff.arcane_charge.stack=4&(!talent.prismatic_crystal.enabled|cooldown.prismatic_crystal.remains>15))
+	if TimeToDie() < 30 or DebuffStacks(arcane_charge_debuff) == 4 and { not Talent(prismatic_crystal_talent) or SpellCooldown(prismatic_crystal) > 15 } ArcaneCooldownsShortCdActions()
+
+	unless { BuffStacks(arcane_missiles_buff) == 3 or Talent(overpowered_talent) and BuffPresent(arcane_power_buff) and BuffRemaining(arcane_power_buff) < ExecuteTime(arcane_blast) } and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles) or ArmorSetBonus(T17 4) and BuffPresent(arcane_instability_buff) and BuffRemaining(arcane_instability_buff) < ExecuteTime(arcane_blast) and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles) or not target.Name(prismatic_crystal) and DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < 3.6 } and Spell(nether_tempest) or { TimeToDie() < 8 or Charges(supernova) == 2 and { BuffPresent(arcane_power_buff) or not { not SpellCooldown(arcane_power) > 0 } } and { not Talent(prismatic_crystal_talent) or SpellCooldown(prismatic_crystal) > 8 } } and Spell(supernova)
 	{
 		#arcane_orb,if=buff.arcane_charge.stack<2
 		if DebuffStacks(arcane_charge_debuff) < 2 Spell(arcane_orb)
-		#presence_of_mind,if=mana.pct>96
-		if ManaPercent() > 96 Spell(presence_of_mind)
-
-		unless DebuffStacks(arcane_charge_debuff) == 4 and ManaPercent() > 93 and Spell(arcane_blast)
-			or DebuffStacks(arcane_charge_debuff) == 4 and { not Talent(overpowered_talent) or SpellCooldown(arcane_power) > 10 * 100 / { 100 + SpellHaste() } } and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles)
-			or ManaPercent() < 96 and { BuffStacks(arcane_missiles_buff) < 2 or DebuffStacks(arcane_charge_debuff) == 4 } and { BuffPresent(arcane_power_buff) or Charges(supernova) == 1 and SpellCooldown(arcane_power) > SpellChargeCooldown(supernova) } and { not Talent(prismatic_crystal_talent) or target.Name(prismatic_crystal) or Charges(supernova) == 1 and SpellCooldown(prismatic_crystal) > SpellChargeCooldown(supernova) + 8 } and Spell(supernova)
-			or not target.Name(prismatic_crystal) and DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < { 10 - 3 * Talent(arcane_orb_talent) } * 100 / { 100 + SpellHaste() } } and Spell(nether_tempest)
-			or DebuffStacks(arcane_charge_debuff) == 4 and Spell(arcane_barrage)
+		#presence_of_mind,if=mana.pct>96&(!talent.prismatic_crystal.enabled|!cooldown.prismatic_crystal.up)
+		if ManaPercent() > 96 and { not Talent(prismatic_crystal_talent) or not { not SpellCooldown(prismatic_crystal) > 0 } } Spell(presence_of_mind)
+
+		unless DebuffStacks(arcane_charge_debuff) == 4 and ManaPercent() > 93 and Spell(arcane_blast) or DebuffStacks(arcane_charge_debuff) == 4 and { not Talent(overpowered_talent) or SpellCooldown(arcane_power) > 10 * 100 / { 100 + SpellHaste() } } and BuffPresent(arcane_missiles_buff) and Spell(arcane_missiles) or ManaPercent() < 96 and { BuffStacks(arcane_missiles_buff) < 2 or DebuffStacks(arcane_charge_debuff) == 4 } and { BuffPresent(arcane_power_buff) or Charges(supernova) == 1 and SpellCooldown(arcane_power) > SpellChargeCooldown(supernova) } and { not Talent(prismatic_crystal_talent) or target.Name(prismatic_crystal) or Charges(supernova) == 1 and SpellCooldown(prismatic_crystal) > SpellChargeCooldown(supernova) + 8 } and Spell(supernova) or not target.Name(prismatic_crystal) and DebuffStacks(arcane_charge_debuff) == 4 and { not DebuffCountOnAny(nether_tempest_debuff) > 0 or target.DebuffPresent(nether_tempest_debuff) and target.DebuffRemaining(nether_tempest_debuff) < { 10 - 3 * TalentPoints(arcane_orb_talent) } * 100 / { 100 + SpellHaste() } } and Spell(nether_tempest) or DebuffStacks(arcane_charge_debuff) == 4 and Spell(arcane_barrage)
 		{
-			#presence_of_mind,if=buff.arcane_charge.stack<2
-			if DebuffStacks(arcane_charge_debuff) < 2 Spell(presence_of_mind)
+			#presence_of_mind,if=buff.arcane_charge.stack<2&(!talent.prismatic_crystal.enabled|!cooldown.prismatic_crystal.up)
+			if DebuffStacks(arcane_charge_debuff) < 2 and { not Talent(prismatic_crystal_talent) or not { not SpellCooldown(prismatic_crystal) > 0 } } Spell(presence_of_mind)
 		}
 	}
 }
@@ -265,12 +258,16 @@ AddFunction ArcaneConserveCdActions
 	if TimeToDie() < 30 or DebuffStacks(arcane_charge_debuff) == 4 and { not Talent(prismatic_crystal_talent) or SpellCooldown(prismatic_crystal) > 15 } ArcaneCooldownsCdActions()
 }

-# ActionList: ArcaneCooldownsActions --> cd
+### actions.cooldowns

-AddFunction ArcaneCooldownsCdActions
+AddFunction ArcaneCooldownsShortCdActions
 {
 	#arcane_power
 	Spell(arcane_power)
+}
+
+AddFunction ArcaneCooldownsCdActions
+{
 	#blood_fury
 	Spell(blood_fury_sp)
 	#berserking
@@ -281,22 +278,34 @@ AddFunction ArcaneCooldownsCdActions
 	if BuffPresent(arcane_power_buff) and { not Talent(prismatic_crystal_talent) or TotemPresent(prismatic_crystal) } UsePotionIntellect()
 }

-# ActionList: ArcaneCrystalSequenceActions --> main, shortcd, cd
+### actions.crystal_sequence

-AddFunction ArcaneCrystalSequenceActions
+AddFunction ArcaneCrystalSequenceMainActions
 {
 	#nether_tempest,if=buff.arcane_charge.stack=4&!ticking&pet.prismatic_crystal.remains>8
-	if DebuffStacks(arcane_charge_debuff) == 4 and not target.DebuffPresent(nether_tempest_debuff) and TotemRemaining(crystal totem=prismatic_crystal) > 8 Spell(nether_tempest)
-	#call_action_list,name=burn
-	ArcaneBurnActions()
+	if DebuffStacks(arcane_charge_debuff) == 4 and not target.DebuffPresent(nether_tempest_debuff) and TotemRemaining(prismatic_crystal) > 8 Spell(nether_tempest)
+	#supernova,if=mana.pct<96
+	if ManaPercent() < 96 Spell(supernova)
+	#arcane_blast,if=buff.arcane_charge.stack=4&mana.pct>93&pet.prismatic_crystal.remains>cast_time+buff.arcane_missiles.stack*2*spell_haste+action.arcane_missiles.travel_time
+	if DebuffStacks(arcane_charge_debuff) == 4 and ManaPercent() > 93 and TotemRemaining(prismatic_crystal) > CastTime(arcane_blast) + BuffStacks(arcane_missiles_buff) * 2 * 100 / { 100 + SpellHaste() } + MaxTravelTime(arcane_missiles) Spell(arcane_blast)
+	#arcane_missiles,if=pet.prismatic_crystal.remains>2*spell_haste+travel_time
+	if TotemRemaining(prismatic_crystal) > 2 * 100 / { 100 + SpellHaste() } + MaxTravelTime(arcane_missiles) and BuffPresent(arcane_missiles_buff) Spell(arcane_missiles)
+	#supernova,if=pet.prismatic_crystal.remains<action.arcane_blast.cast_time
+	if TotemRemaining(prismatic_crystal) < CastTime(arcane_blast) Spell(supernova)
+	#choose_target,if=pet.prismatic_crystal.remains<action.arcane_blast.cast_time&buff.presence_of_mind.down
+	#arcane_blast
+	Spell(arcane_blast)
 }

 AddFunction ArcaneCrystalSequenceShortCdActions
 {
-	unless DebuffStacks(arcane_charge_debuff) == 4 and not target.DebuffPresent(nether_tempest_debuff) and TotemRemaining(crystal totem=prismatic_crystal) > 8 and Spell(nether_tempest)
+	#call_action_list,name=cooldowns
+	ArcaneCooldownsShortCdActions()
+
+	unless DebuffStacks(arcane_charge_debuff) == 4 and not target.DebuffPresent(nether_tempest_debuff) and TotemRemaining(prismatic_crystal) > 8 and Spell(nether_tempest) or ManaPercent() < 96 and Spell(supernova)
 	{
-		#call_action_list,name=burn
-		ArcaneBurnShortCdActions()
+		#presence_of_mind,if=cooldown.cold_snap.up|pet.prismatic_crystal.remains<action.arcane_blast.cast_time
+		if not SpellCooldown(cold_snap) > 0 or TotemRemaining(prismatic_crystal) < CastTime(arcane_blast) Spell(presence_of_mind)
 	}
 }

@@ -304,20 +313,14 @@ AddFunction ArcaneCrystalSequenceCdActions
 {
 	#call_action_list,name=cooldowns
 	ArcaneCooldownsCdActions()
-
-	unless DebuffStacks(arcane_charge_debuff) == 4 and not target.DebuffPresent(nether_tempest_debuff) and TotemRemaining(crystal totem=prismatic_crystal) > 8 and Spell(nether_tempest)
-	{
-		#call_action_list,name=burn
-		ArcaneBurnCdActions()
-	}
 }

-# ActionList: ArcaneInitCrystalActions --> main, shortcd, cd
+### actions.init_crystal

-AddFunction ArcaneInitCrystalActions
+AddFunction ArcaneInitCrystalMainActions
 {
 	#call_action_list,name=conserve,if=buff.arcane_charge.stack<4
-	if DebuffStacks(arcane_charge_debuff) < 4 ArcaneConserveActions()
+	if DebuffStacks(arcane_charge_debuff) < 4 ArcaneConserveMainActions()
 }

 AddFunction ArcaneInitCrystalShortCdActions
@@ -326,8 +329,8 @@ AddFunction ArcaneInitCrystalShortCdActions
 	if DebuffStacks(arcane_charge_debuff) < 4 ArcaneConserveShortCdActions()
 	#prismatic_crystal,if=buff.arcane_charge.stack=4&cooldown.arcane_power.remains<0.5
 	if DebuffStacks(arcane_charge_debuff) == 4 and SpellCooldown(arcane_power) < 0.5 Spell(prismatic_crystal)
-	#prismatic_crystal,if=glyph.arcane_power.enabled&buff.arcane_charge.stack=4&cooldown.arcane_power.remains>45
-	if Glyph(glyph_of_arcane_power) and DebuffStacks(arcane_charge_debuff) == 4 and SpellCooldown(arcane_power) > 45 Spell(prismatic_crystal)
+	#prismatic_crystal,if=glyph.arcane_power.enabled&buff.arcane_charge.stack=4&cooldown.arcane_power.remains>75
+	if Glyph(glyph_of_arcane_power) and DebuffStacks(arcane_charge_debuff) == 4 and SpellCooldown(arcane_power) > 75 Spell(prismatic_crystal)
 }

 AddFunction ArcaneInitCrystalCdActions
@@ -336,15 +339,14 @@ AddFunction ArcaneInitCrystalCdActions
 	if DebuffStacks(arcane_charge_debuff) < 4 ArcaneConserveCdActions()
 }

-# ActionList: ArcanePrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction ArcanePrecombatActions
+AddFunction ArcanePrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=sleeper_surprise
 	#arcane_brilliance
 	if BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) Spell(arcane_brilliance)
-	#snapshot_stats
 	#arcane_blast
 	Spell(arcane_blast)
 }
@@ -353,6 +355,7 @@ AddFunction ArcanePrecombatShortCdActions
 {
 	unless { BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) } and Spell(arcane_brilliance)
 	{
+		#snapshot_stats
 		# CHANGE: Only suggest Rune of Power if the rune needs to be refreshed prior to pull.
 		#rune_of_power
 		#Spell(rune_of_power)
@@ -362,8 +365,7 @@ AddFunction ArcanePrecombatShortCdActions

 AddFunction ArcanePrecombatCdActions
 {
-	unless { BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) } and Spell(arcane_brilliance)
-		or TotemRemaining(rune_of_power) < 150 and Spell(rune_of_power)
+	unless { BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) } and Spell(arcane_brilliance) or Spell(rune_of_power)
 	{
 		#mirror_image
 		Spell(mirror_image)
@@ -381,20 +383,20 @@ AddFunction ArcanePrecombatCdActions
 #	talents=3003322
 #	glyphs=inferno_blast/combustion/dragons_breath

-# ActionList: FireDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction FireDefaultActions
+AddFunction FireDefaultMainActions
 {
 	#call_action_list,name=combust_sequence,if=pyro_chain
-	if GetState(pyro_chain) > 0 FireCombustSequenceActions()
+	if GetState(pyro_chain) > 0 FireCombustSequenceMainActions()
 	#call_action_list,name=crystal_sequence,if=talent.prismatic_crystal.enabled&pet.prismatic_crystal.active
-	if Talent(prismatic_crystal_talent) and TotemPresent(prismatic_crystal) FireCrystalSequenceActions()
+	if Talent(prismatic_crystal_talent) and TotemPresent(prismatic_crystal) FireCrystalSequenceMainActions()
 	#call_action_list,name=init_combust,if=!pyro_chain
-	if not GetState(pyro_chain) > 0 FireInitCombustActions()
+	if not GetState(pyro_chain) > 0 FireInitCombustMainActions()
 	#call_action_list,name=aoe,if=active_enemies>=4
-	if Enemies() >= 4 FireAoeActions()
+	if Enemies() >= 4 FireAoeMainActions()
 	#call_action_list,name=single_target
-	FireSingleTargetActions()
+	FireSingleTargetMainActions()
 }

 AddFunction FireDefaultShortCdActions
@@ -425,37 +427,36 @@ AddFunction FireDefaultCdActions
 {
 	#counterspell,if=target.debuff.casting.react
 	if target.IsInterruptible() InterruptActions()
-	#time_warp,if=target.health.pct<25|time>5
-	if { target.HealthPercent() < 25 or TimeInCombat() > 5 } and CheckBoxOn(opt_time_warp) and DebuffExpires(burst_haste_debuff any=1) Spell(time_warp)

-	unless BuffExpires(ice_floes_buff) and { 0 > 0 or 600 < CastTime(fireball) } and Spell(ice_floes)
-		or TotemRemaining(rune_of_power) < CastTime(rune_of_power) and Spell(rune_of_power)
+	unless 0 > 10 and Spell(blink)
 	{
-		#call_action_list,name=combust_sequence,if=pyro_chain
-		if GetState(pyro_chain) > 0 FireCombustSequenceCdActions()
-		#call_action_list,name=crystal_sequence,if=talent.prismatic_crystal.enabled&pet.prismatic_crystal.active
-		if Talent(prismatic_crystal_talent) and TotemPresent(prismatic_crystal) FireCrystalSequenceCdActions()
-		#call_action_list,name=init_combust,if=!pyro_chain
-		if not GetState(pyro_chain) > 0 FireInitCombustCdActions()
-
-		unless TotemRemaining(rune_of_power) < ExecuteTime(fireball) + GCD() and not { BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } } and Spell(rune_of_power)
+		#time_warp,if=target.health.pct<25|time>5
+		if { target.HealthPercent() < 25 or TimeInCombat() > 5 } and CheckBoxOn(opt_time_warp) and DebuffExpires(burst_haste_debuff any=1) Spell(time_warp)
+
+		unless BuffExpires(ice_floes_buff) and { 0 > 0 or 600 < CastTime(fireball) } and Spell(ice_floes) or TotemRemaining(rune_of_power) < CastTime(rune_of_power) and Spell(rune_of_power)
 		{
-			#mirror_image,if=!(buff.heating_up.up&action.fireball.in_flight)
-			if not { BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } } Spell(mirror_image)
-			#call_action_list,name=aoe,if=active_enemies>=4
-			if Enemies() >= 4 FireAoeCdActions()
-			#call_action_list,name=single_target
-			FireSingleTargetCdActions()
+			#call_action_list,name=combust_sequence,if=pyro_chain
+			if GetState(pyro_chain) > 0 FireCombustSequenceCdActions()
+			#call_action_list,name=init_combust,if=!pyro_chain
+			if not GetState(pyro_chain) > 0 FireInitCombustCdActions()
+
+			unless TotemRemaining(rune_of_power) < ExecuteTime(fireball) + GCD() and not { BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } } and Spell(rune_of_power)
+			{
+				#mirror_image,if=!(buff.heating_up.up&action.fireball.in_flight)
+				if not { BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } } Spell(mirror_image)
+				#call_action_list,name=aoe,if=active_enemies>=4
+				if Enemies() >= 4 FireAoeCdActions()
+			}
 		}
 	}
 }

-# ActionList: FireActiveTalentsActions --> main, shortcd, cd
+### actions.active_talents

-AddFunction FireActiveTalentsActions
+AddFunction FireActiveTalentsMainActions
 {
 	#call_action_list,name=living_bomb,if=talent.living_bomb.enabled
-	if Talent(living_bomb_talent) FireLivingBombActions()
+	if Talent(living_bomb_talent) FireLivingBombMainActions()
 	#blast_wave,if=(!talent.incanters_flow.enabled|buff.incanters_flow.stack>=4)&(time_to_die<10|!talent.prismatic_crystal.enabled|(charges=1&cooldown.prismatic_crystal.remains>recharge_time)|charges=2|current_target=prismatic_crystal)
 	if { not Talent(incanters_flow_talent) or BuffStacks(incanters_flow_buff) >= 4 } and { TimeToDie() < 10 or not Talent(prismatic_crystal_talent) or Charges(blast_wave) == 1 and SpellCooldown(prismatic_crystal) > SpellChargeCooldown(blast_wave) or Charges(blast_wave) == 2 or target.Name(prismatic_crystal) } Spell(blast_wave)
 }
@@ -466,16 +467,14 @@ AddFunction FireActiveTalentsShortCdActions
 	if Enemies() >= 5 or Glyph(glyph_of_combustion) and { not Talent(incanters_flow_talent) or BuffStacks(incanters_flow_buff) + BuffDirection(incanters_flow_buff) >= 4 } and SpellCooldownDuration(meteor) - SpellCooldown(combustion) < 10 Spell(meteor)
 }

-AddFunction FireActiveTalentsCdActions {}
-
-# ActionList: FireAoeActions --> main, shortcd, cd
+### actions.aoe

-AddFunction FireAoeActions
+AddFunction FireAoeMainActions
 {
 	#inferno_blast,cycle_targets=1,if=(dot.combustion.ticking&active_dot.combustion<active_enemies)|(dot.pyroblast.ticking&active_dot.pyroblast<active_enemies)
 	if target.DebuffPresent(combustion_debuff) and DebuffCountOnAny(combustion_debuff) < Enemies() or target.DebuffPresent(pyroblast_debuff) and DebuffCountOnAny(pyroblast_debuff) < Enemies() Spell(inferno_blast)
 	#call_action_list,name=active_talents
-	FireActiveTalentsActions()
+	FireActiveTalentsMainActions()
 	#pyroblast,if=buff.pyroblast.react|buff.pyromaniac.react
 	if BuffPresent(pyroblast_buff) or BuffPresent(pyromaniac_buff) Spell(pyroblast)
 	#pyroblast,if=active_dot.pyroblast=0&!in_flight
@@ -499,11 +498,7 @@ AddFunction FireAoeCdActions
 {
 	unless { target.DebuffPresent(combustion_debuff) and DebuffCountOnAny(combustion_debuff) < Enemies() or target.DebuffPresent(pyroblast_debuff) and DebuffCountOnAny(pyroblast_debuff) < Enemies() } and Spell(inferno_blast)
 	{
-		#call_action_list,name=active_talents
-		FireActiveTalentsCdActions()
-
-		unless { BuffPresent(pyroblast_buff) or BuffPresent(pyromaniac_buff) } and Spell(pyroblast)
-			or not DebuffCountOnAny(pyroblast_debuff) > 0 and not InFlightToTarget(pyroblast) and Spell(pyroblast)
+		unless { BuffPresent(pyroblast_buff) or BuffPresent(pyromaniac_buff) } and Spell(pyroblast) or not DebuffCountOnAny(pyroblast_debuff) > 0 and not InFlightToTarget(pyroblast) and Spell(pyroblast)
 		{
 			#cold_snap,if=glyph.dragons_breath.enabled&!cooldown.dragons_breath.up
 			if Glyph(glyph_of_dragons_breath) and not { not SpellCooldown(dragons_breath) > 0 } Spell(cold_snap)
@@ -511,9 +506,9 @@ AddFunction FireAoeCdActions
 	}
 }

-# ActionList: FireCombustSequenceActions --> main, shortcd, cd
+### actions.combust_sequence

-AddFunction FireCombustSequenceActions
+AddFunction FireCombustSequenceMainActions
 {
 	#stop_pyro_chain,if=cooldown.combustion.duration-cooldown.combustion.remains<15
 	if SpellCooldownDuration(combustion) - SpellCooldown(combustion) < 15 SetState(pyro_chain 0)
@@ -538,11 +533,7 @@ AddFunction FireCombustSequenceShortCdActions
 	#meteor
 	Spell(meteor)

-	unless ArmorSetBonus(T17 4) and BuffPresent(pyromaniac_buff) and Spell(pyroblast)
-		or ArmorSetBonus(T16_caster 4) and BuffPresent(pyroblast_buff) xor BuffPresent(heating_up_buff) and Spell(inferno_blast)
-		or not target.DebuffPresent(ignite_debuff) and not { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } and Spell(fireball)
-		or BuffPresent(pyroblast_buff) and Spell(pyroblast)
-		or Talent(meteor_talent) and SpellCooldownDuration(meteor) - SpellCooldown(meteor) < GCD() * 3 and Spell(inferno_blast)
+	unless ArmorSetBonus(T17 4) and BuffPresent(pyromaniac_buff) and Spell(pyroblast) or ArmorSetBonus(T16_caster 4) and { BuffPresent(pyroblast_buff) xor BuffPresent(heating_up_buff) } and Spell(inferno_blast) or not target.DebuffPresent(ignite_debuff) and not { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } and Spell(fireball) or BuffPresent(pyroblast_buff) and Spell(pyroblast) or Talent(meteor_talent) and SpellCooldownDuration(meteor) - SpellCooldown(meteor) < GCD() * 3 and Spell(inferno_blast)
 	{
 		#combustion
 		Spell(combustion)
@@ -567,41 +558,30 @@ AddFunction FireCombustSequenceCdActions
 	}
 }

-# ActionList: FireCrystalSequenceActions --> main, shortcd, cd
+### actions.crystal_sequence

-AddFunction FireCrystalSequenceActions
+AddFunction FireCrystalSequenceMainActions
 {
 	#inferno_blast,cycle_targets=1,if=dot.combustion.ticking&active_dot.combustion<active_enemies+1
 	if target.DebuffPresent(combustion_debuff) and DebuffCountOnAny(combustion_debuff) < Enemies() + 1 Spell(inferno_blast)
 	#pyroblast,if=execute_time=gcd.max&pet.prismatic_crystal.remains<gcd.max+travel_time&pet.prismatic_crystal.remains>travel_time
-	if ExecuteTime(pyroblast) == GCD() and TotemRemaining(crystal totem=prismatic_crystal) < GCD() + MaxTravelTime(pyroblast) and TotemRemaining(crystal totem=prismatic_crystal) > MaxTravelTime(pyroblast) Spell(pyroblast)
+	if ExecuteTime(pyroblast) == GCD() and TotemRemaining(prismatic_crystal) < GCD() + MaxTravelTime(pyroblast) and TotemRemaining(prismatic_crystal) > MaxTravelTime(pyroblast) Spell(pyroblast)
 	#call_action_list,name=single_target
-	FireSingleTargetActions()
+	FireSingleTargetMainActions()
 }

 AddFunction FireCrystalSequenceShortCdActions
 {
-	unless target.DebuffPresent(combustion_debuff) and DebuffCountOnAny(combustion_debuff) < Enemies() + 1 and Spell(inferno_blast)
-		or ExecuteTime(pyroblast) == GCD() and TotemRemaining(crystal totem=prismatic_crystal) < GCD() + MaxTravelTime(pyroblast) and TotemRemaining(crystal totem=prismatic_crystal) > MaxTravelTime(pyroblast) and Spell(pyroblast)
-	{
-		#call_action_list,name=single_target
-		FireSingleTargetCdActions()
-	}
-}
-
-AddFunction FireCrystalSequenceCdActions
-{
-	unless target.DebuffPresent(combustion_debuff) and DebuffCountOnAny(combustion_debuff) < Enemies() + 1 and Spell(inferno_blast)
-		or ExecuteTime(pyroblast) == GCD() and TotemRemaining(crystal totem=prismatic_crystal) < GCD() + MaxTravelTime(pyroblast) and TotemRemaining(crystal totem=prismatic_crystal) > MaxTravelTime(pyroblast) and Spell(pyroblast)
+	unless target.DebuffPresent(combustion_debuff) and DebuffCountOnAny(combustion_debuff) < Enemies() + 1 and Spell(inferno_blast) or ExecuteTime(pyroblast) == GCD() and TotemRemaining(prismatic_crystal) < GCD() + MaxTravelTime(pyroblast) and TotemRemaining(prismatic_crystal) > MaxTravelTime(pyroblast) and Spell(pyroblast)
 	{
 		#call_action_list,name=single_target
-		FireSingleTargetCdActions()
+		FireSingleTargetShortCdActions()
 	}
 }

-# ActionList: FireInitCombustActions --> main, shortcd, cd
+### actions.init_combust

-AddFunction FireInitCombustActions
+AddFunction FireInitCombustMainActions
 {
 	#start_pyro_chain,if=talent.meteor.enabled&cooldown.meteor.up&((cooldown.combustion.remains<gcd.max*3&buff.pyroblast.up&(buff.heating_up.up^action.fireball.in_flight))|(buff.pyromaniac.up&(cooldown.combustion.remains<ceil(buff.pyromaniac.remains%gcd.max)*gcd.max)))
 	if Talent(meteor_talent) and not SpellCooldown(meteor) > 0 and { SpellCooldown(combustion) < GCD() * 3 and BuffPresent(pyroblast_buff) and { BuffPresent(heating_up_buff) xor { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } } or BuffPresent(pyromaniac_buff) and SpellCooldown(combustion) < BuffRemaining(pyromaniac_buff) / GCD() * GCD() } SetState(pyro_chain 1)
@@ -610,22 +590,36 @@ AddFunction FireInitCombustActions
 	#start_pyro_chain,if=talent.prismatic_crystal.enabled&!glyph.combustion.enabled&cooldown.prismatic_crystal.remains>20&((cooldown.combustion.remains<gcd.max*2&buff.pyroblast.up&buff.heating_up.up&action.fireball.in_flight)|(buff.pyromaniac.up&(cooldown.combustion.remains<ceil(buff.pyromaniac.remains%gcd.max)*gcd.max)))
 	if Talent(prismatic_crystal_talent) and not Glyph(glyph_of_combustion) and SpellCooldown(prismatic_crystal) > 20 and { SpellCooldown(combustion) < GCD() * 2 and BuffPresent(pyroblast_buff) and BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } or BuffPresent(pyromaniac_buff) and SpellCooldown(combustion) < BuffRemaining(pyromaniac_buff) / GCD() * GCD() } SetState(pyro_chain 1)
 	#start_pyro_chain,if=!talent.prismatic_crystal.enabled&!talent.meteor.enabled&((cooldown.combustion.remains<gcd.max*4&buff.pyroblast.up&buff.heating_up.up&action.fireball.in_flight)|(buff.pyromaniac.up&cooldown.combustion.remains<ceil(buff.pyromaniac.remains%gcd.max)*(gcd.max+talent.kindling.enabled)))
-	if not Talent(prismatic_crystal_talent) and not Talent(meteor_talent) and { SpellCooldown(combustion) < GCD() * 4 and BuffPresent(pyroblast_buff) and BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } or BuffPresent(pyromaniac_buff) and SpellCooldown(combustion) < BuffRemaining(pyromaniac_buff) / GCD() * { GCD() + Talent(kindling_talent) } } SetState(pyro_chain 1)
+	if not Talent(prismatic_crystal_talent) and not Talent(meteor_talent) and { SpellCooldown(combustion) < GCD() * 4 and BuffPresent(pyroblast_buff) and BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } or BuffPresent(pyromaniac_buff) and SpellCooldown(combustion) < BuffRemaining(pyromaniac_buff) / GCD() * { GCD() + TalentPoints(kindling_talent) } } SetState(pyro_chain 1)
 }

 AddFunction FireInitCombustShortCdActions
 {
-	FireInitCombustActions()
+	#start_pyro_chain,if=talent.meteor.enabled&cooldown.meteor.up&((cooldown.combustion.remains<gcd.max*3&buff.pyroblast.up&(buff.heating_up.up^action.fireball.in_flight))|(buff.pyromaniac.up&(cooldown.combustion.remains<ceil(buff.pyromaniac.remains%gcd.max)*gcd.max)))
+	if Talent(meteor_talent) and not SpellCooldown(meteor) > 0 and { SpellCooldown(combustion) < GCD() * 3 and BuffPresent(pyroblast_buff) and { BuffPresent(heating_up_buff) xor { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } } or BuffPresent(pyromaniac_buff) and SpellCooldown(combustion) < BuffRemaining(pyromaniac_buff) / GCD() * GCD() } SetState(pyro_chain 1)
+	#start_pyro_chain,if=talent.prismatic_crystal.enabled&cooldown.prismatic_crystal.up&((cooldown.combustion.remains<gcd.max*2&buff.pyroblast.up&(buff.heating_up.up^action.fireball.in_flight))|(buff.pyromaniac.up&(cooldown.combustion.remains<ceil(buff.pyromaniac.remains%gcd.max)*gcd.max)))
+	if Talent(prismatic_crystal_talent) and not SpellCooldown(prismatic_crystal) > 0 and { SpellCooldown(combustion) < GCD() * 2 and BuffPresent(pyroblast_buff) and { BuffPresent(heating_up_buff) xor { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } } or BuffPresent(pyromaniac_buff) and SpellCooldown(combustion) < BuffRemaining(pyromaniac_buff) / GCD() * GCD() } SetState(pyro_chain 1)
+	#start_pyro_chain,if=talent.prismatic_crystal.enabled&!glyph.combustion.enabled&cooldown.prismatic_crystal.remains>20&((cooldown.combustion.remains<gcd.max*2&buff.pyroblast.up&buff.heating_up.up&action.fireball.in_flight)|(buff.pyromaniac.up&(cooldown.combustion.remains<ceil(buff.pyromaniac.remains%gcd.max)*gcd.max)))
+	if Talent(prismatic_crystal_talent) and not Glyph(glyph_of_combustion) and SpellCooldown(prismatic_crystal) > 20 and { SpellCooldown(combustion) < GCD() * 2 and BuffPresent(pyroblast_buff) and BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } or BuffPresent(pyromaniac_buff) and SpellCooldown(combustion) < BuffRemaining(pyromaniac_buff) / GCD() * GCD() } SetState(pyro_chain 1)
+	#start_pyro_chain,if=!talent.prismatic_crystal.enabled&!talent.meteor.enabled&((cooldown.combustion.remains<gcd.max*4&buff.pyroblast.up&buff.heating_up.up&action.fireball.in_flight)|(buff.pyromaniac.up&cooldown.combustion.remains<ceil(buff.pyromaniac.remains%gcd.max)*(gcd.max+talent.kindling.enabled)))
+	if not Talent(prismatic_crystal_talent) and not Talent(meteor_talent) and { SpellCooldown(combustion) < GCD() * 4 and BuffPresent(pyroblast_buff) and BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } or BuffPresent(pyromaniac_buff) and SpellCooldown(combustion) < BuffRemaining(pyromaniac_buff) / GCD() * { GCD() + TalentPoints(kindling_talent) } } SetState(pyro_chain 1)
 }

 AddFunction FireInitCombustCdActions
 {
-	FireInitCombustActions()
+	#start_pyro_chain,if=talent.meteor.enabled&cooldown.meteor.up&((cooldown.combustion.remains<gcd.max*3&buff.pyroblast.up&(buff.heating_up.up^action.fireball.in_flight))|(buff.pyromaniac.up&(cooldown.combustion.remains<ceil(buff.pyromaniac.remains%gcd.max)*gcd.max)))
+	if Talent(meteor_talent) and not SpellCooldown(meteor) > 0 and { SpellCooldown(combustion) < GCD() * 3 and BuffPresent(pyroblast_buff) and { BuffPresent(heating_up_buff) xor { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } } or BuffPresent(pyromaniac_buff) and SpellCooldown(combustion) < BuffRemaining(pyromaniac_buff) / GCD() * GCD() } SetState(pyro_chain 1)
+	#start_pyro_chain,if=talent.prismatic_crystal.enabled&cooldown.prismatic_crystal.up&((cooldown.combustion.remains<gcd.max*2&buff.pyroblast.up&(buff.heating_up.up^action.fireball.in_flight))|(buff.pyromaniac.up&(cooldown.combustion.remains<ceil(buff.pyromaniac.remains%gcd.max)*gcd.max)))
+	if Talent(prismatic_crystal_talent) and not SpellCooldown(prismatic_crystal) > 0 and { SpellCooldown(combustion) < GCD() * 2 and BuffPresent(pyroblast_buff) and { BuffPresent(heating_up_buff) xor { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } } or BuffPresent(pyromaniac_buff) and SpellCooldown(combustion) < BuffRemaining(pyromaniac_buff) / GCD() * GCD() } SetState(pyro_chain 1)
+	#start_pyro_chain,if=talent.prismatic_crystal.enabled&!glyph.combustion.enabled&cooldown.prismatic_crystal.remains>20&((cooldown.combustion.remains<gcd.max*2&buff.pyroblast.up&buff.heating_up.up&action.fireball.in_flight)|(buff.pyromaniac.up&(cooldown.combustion.remains<ceil(buff.pyromaniac.remains%gcd.max)*gcd.max)))
+	if Talent(prismatic_crystal_talent) and not Glyph(glyph_of_combustion) and SpellCooldown(prismatic_crystal) > 20 and { SpellCooldown(combustion) < GCD() * 2 and BuffPresent(pyroblast_buff) and BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } or BuffPresent(pyromaniac_buff) and SpellCooldown(combustion) < BuffRemaining(pyromaniac_buff) / GCD() * GCD() } SetState(pyro_chain 1)
+	#start_pyro_chain,if=!talent.prismatic_crystal.enabled&!talent.meteor.enabled&((cooldown.combustion.remains<gcd.max*4&buff.pyroblast.up&buff.heating_up.up&action.fireball.in_flight)|(buff.pyromaniac.up&cooldown.combustion.remains<ceil(buff.pyromaniac.remains%gcd.max)*(gcd.max+talent.kindling.enabled)))
+	if not Talent(prismatic_crystal_talent) and not Talent(meteor_talent) and { SpellCooldown(combustion) < GCD() * 4 and BuffPresent(pyroblast_buff) and BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } or BuffPresent(pyromaniac_buff) and SpellCooldown(combustion) < BuffRemaining(pyromaniac_buff) / GCD() * { GCD() + TalentPoints(kindling_talent) } } SetState(pyro_chain 1)
 }

-# ActionList: FireLivingBombActions --> main
+### actions.living_bomb

-AddFunction FireLivingBombActions
+AddFunction FireLivingBombMainActions
 {
 	#inferno_blast,cycle_targets=1,if=dot.living_bomb.ticking&active_dot.living_bomb<active_enemies
 	if target.DebuffPresent(living_bomb_debuff) and DebuffCountOnAny(living_bomb_debuff) < Enemies() Spell(inferno_blast)
@@ -633,15 +627,14 @@ AddFunction FireLivingBombActions
 	if not target.Name(prismatic_crystal) and { not DebuffCountOnAny(living_bomb_debuff) > 0 or target.DebuffPresent(living_bomb_debuff) and DebuffCountOnAny(living_bomb_debuff) == 1 } and { { not Talent(incanters_flow_talent) or BuffDirection(incanters_flow_buff) < 0 or BuffStacks(incanters_flow_buff) == 5 } and target.DebuffRemaining(living_bomb_debuff) < 3.6 or { BuffDirection(incanters_flow_buff) > 0 or BuffStacks(incanters_flow_buff) == 1 } and target.DebuffRemaining(living_bomb_debuff) < GCD() } and target.TimeToDie() > target.DebuffRemaining(living_bomb_debuff) + 12 Spell(living_bomb)
 }

-# ActionList: FirePrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction FirePrecombatActions
+AddFunction FirePrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=blackrock_barbecue
 	#arcane_brilliance
 	if BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) Spell(arcane_brilliance)
-	#snapshot_stats
 	#pyroblast
 	Spell(pyroblast)
 }
@@ -650,6 +643,7 @@ AddFunction FirePrecombatShortCdActions
 {
 	unless { BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) } and Spell(arcane_brilliance)
 	{
+		#snapshot_stats
 		# CHANGE: Only suggest Rune of Power if the rune needs to be refreshed prior to pull.
 		#rune_of_power
 		#Spell(rune_of_power)
@@ -659,8 +653,7 @@ AddFunction FirePrecombatShortCdActions

 AddFunction FirePrecombatCdActions
 {
-	unless { BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) } and Spell(arcane_brilliance)
-		or TotemRemaining(rune_of_power) < 150 and Spell(rune_of_power)
+	unless { BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) } and Spell(arcane_brilliance) or Spell(rune_of_power)
 	{
 		#mirror_image
 		Spell(mirror_image)
@@ -669,9 +662,9 @@ AddFunction FirePrecombatCdActions
 	}
 }

-# ActionList: FireSingleTargetActions --> main, shortcd, cd
+### actions.single_target

-AddFunction FireSingleTargetActions
+AddFunction FireSingleTargetMainActions
 {
 	#inferno_blast,if=(dot.combustion.ticking&active_dot.combustion<active_enemies)|(dot.living_bomb.ticking&active_dot.living_bomb<active_enemies)
 	if target.DebuffPresent(combustion_debuff) and DebuffCountOnAny(combustion_debuff) < Enemies() or target.DebuffPresent(living_bomb_debuff) and DebuffCountOnAny(living_bomb_debuff) < Enemies() Spell(inferno_blast)
@@ -686,7 +679,7 @@ AddFunction FireSingleTargetActions
 	#inferno_blast,if=buff.pyroblast.down&buff.heating_up.up
 	if BuffExpires(pyroblast_buff) and BuffPresent(heating_up_buff) Spell(inferno_blast)
 	#call_action_list,name=active_talents
-	FireActiveTalentsActions()
+	FireActiveTalentsMainActions()
 	#inferno_blast,if=buff.pyroblast.up&buff.heating_up.down&!action.fireball.in_flight
 	if BuffPresent(pyroblast_buff) and BuffExpires(heating_up_buff) and not { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } Spell(inferno_blast)
 	#fireball
@@ -697,32 +690,13 @@ AddFunction FireSingleTargetActions

 AddFunction FireSingleTargetShortCdActions
 {
-	unless { target.DebuffPresent(combustion_debuff) and DebuffCountOnAny(combustion_debuff) < Enemies() or target.DebuffPresent(living_bomb_debuff) and DebuffCountOnAny(living_bomb_debuff) < Enemies() } and Spell(inferno_blast)
-		or BuffPresent(pyroblast_buff) and BuffRemaining(pyroblast_buff) < ExecuteTime(fireball) and Spell(pyroblast)
-		or ArmorSetBonus(T16_caster 2) and BuffPresent(pyroblast_buff) and BuffPresent(potent_flames_buff) and BuffRemaining(potent_flames_buff) < GCD() and Spell(pyroblast)
-		or ArmorSetBonus(T17 4) and BuffPresent(pyromaniac_buff) and Spell(pyroblast)
-		or BuffPresent(pyroblast_buff) and BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } and Spell(pyroblast)
-		or BuffExpires(pyroblast_buff) and BuffPresent(heating_up_buff) and Spell(inferno_blast)
+	unless { target.DebuffPresent(combustion_debuff) and DebuffCountOnAny(combustion_debuff) < Enemies() or target.DebuffPresent(living_bomb_debuff) and DebuffCountOnAny(living_bomb_debuff) < Enemies() } and Spell(inferno_blast) or BuffPresent(pyroblast_buff) and BuffRemaining(pyroblast_buff) < ExecuteTime(fireball) and Spell(pyroblast) or ArmorSetBonus(T16_caster 2) and BuffPresent(pyroblast_buff) and BuffPresent(potent_flames_buff) and BuffRemaining(potent_flames_buff) < GCD() and Spell(pyroblast) or ArmorSetBonus(T17 4) and BuffPresent(pyromaniac_buff) and Spell(pyroblast) or BuffPresent(pyroblast_buff) and BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } and Spell(pyroblast) or BuffExpires(pyroblast_buff) and BuffPresent(heating_up_buff) and Spell(inferno_blast)
 	{
 		#call_action_list,name=active_talents
 		FireActiveTalentsShortCdActions()
 	}
 }

-AddFunction FireSingleTargetCdActions
-{
-	unless { target.DebuffPresent(combustion_debuff) and DebuffCountOnAny(combustion_debuff) < Enemies() or target.DebuffPresent(living_bomb_debuff) and DebuffCountOnAny(living_bomb_debuff) < Enemies() } and Spell(inferno_blast)
-		or BuffPresent(pyroblast_buff) and BuffRemaining(pyroblast_buff) < ExecuteTime(fireball) and Spell(pyroblast)
-		or ArmorSetBonus(T16_caster 2) and BuffPresent(pyroblast_buff) and BuffPresent(potent_flames_buff) and BuffRemaining(potent_flames_buff) < GCD() and Spell(pyroblast)
-		or ArmorSetBonus(T17 4) and BuffPresent(pyromaniac_buff) and Spell(pyroblast)
-		or BuffPresent(pyroblast_buff) and BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } and Spell(pyroblast)
-		or BuffExpires(pyroblast_buff) and BuffPresent(heating_up_buff) and Spell(inferno_blast)
-	{
-		#call_action_list,name=active_talents
-		FireActiveTalentsCdActions()
-	}
-}
-
 ###
 ### Frost
 ###
@@ -732,28 +706,36 @@ AddFunction FireSingleTargetCdActions
 #	talents=3003122
 #	glyphs=icy_veins/splitting_ice/cone_of_cold

-# ActionList: FrostDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction FrostDefaultActions
+AddFunction FrostDefaultMainActions
 {
+	#call_action_list,name=water_jet,if=prev.water_jet|debuff.water_jet.remains>0
+	if PreviousSpell(pet_water_jet) or target.DebuffRemaining(pet_water_jet_debuff) > 0 FrostWaterJetMainActions()
 	#call_action_list,name=crystal_sequence,if=talent.prismatic_crystal.enabled&(cooldown.prismatic_crystal.remains<=gcd.max|pet.prismatic_crystal.active)
-	if Talent(prismatic_crystal_talent) and { SpellCooldown(prismatic_crystal) <= GCD() or TotemPresent(prismatic_crystal) } FrostCrystalSequenceActions()
+	if Talent(prismatic_crystal_talent) and { SpellCooldown(prismatic_crystal) <= GCD() or TotemPresent(prismatic_crystal) } FrostCrystalSequenceMainActions()
 	#call_action_list,name=aoe,if=active_enemies>=4
-	if Enemies() >= 4 FrostAoeActions()
+	if Enemies() >= 4 FrostAoeMainActions()
 	#call_action_list,name=single_target
-	FrostSingleTargetActions()
+	FrostSingleTargetMainActions()
 }

 AddFunction FrostDefaultShortCdActions
 {
+	#blink,if=movement.distance>10
+	if 0 > 10 Spell(blink)
+	#blazing_speed,if=movement.remains>0
+	if 0 > 0 Spell(blazing_speed)
+	#call_action_list,name=water_jet,if=prev.water_jet|debuff.water_jet.remains>0
+	if PreviousSpell(pet_water_jet) or target.DebuffRemaining(pet_water_jet_debuff) > 0 FrostWaterJetShortCdActions()
 	#ice_floes,if=buff.ice_floes.down&(raid_event.movement.distance>0|raid_event.movement.in<action.frostbolt.cast_time)
 	if BuffExpires(ice_floes_buff) and { 0 > 0 or 600 < CastTime(frostbolt) } Spell(ice_floes)
 	#rune_of_power,if=buff.rune_of_power.remains<cast_time
 	if TotemRemaining(rune_of_power) < CastTime(rune_of_power) Spell(rune_of_power)
-	# CHANGE: Check for the talent before any of the spell properties for Prismatic Crystal.
 	#rune_of_power,if=(cooldown.icy_veins.remains<gcd.max&buff.rune_of_power.remains<20)|(cooldown.prismatic_crystal.remains<gcd.max&buff.rune_of_power.remains<10)
-	#if SpellCooldown(icy_veins) < GCD() and TotemRemaining(rune_of_power) < 20 or SpellCooldown(prismatic_crystal) < GCD() and TotemRemaining(rune_of_power) < 10 Spell(rune_of_power)
-	if SpellCooldown(icy_veins) < GCD() and TotemRemaining(rune_of_power) < 20 or { not Talent(prismatic_crystal_talent) or SpellCooldown(prismatic_crystal) < GCD() } and TotemRemaining(rune_of_power) < 10 Spell(rune_of_power)
+	if SpellCooldown(icy_veins) < GCD() and TotemRemaining(rune_of_power) < 20 or SpellCooldown(prismatic_crystal) < GCD() and TotemRemaining(rune_of_power) < 10 Spell(rune_of_power)
+	#water_jet,if=time<1&!(talent.ice_nova.enabled&talent.prismatic_crystal.enabled)
+	if TimeInCombat() < 1 and not { Talent(ice_nova_talent) and Talent(prismatic_crystal_talent) } and pet.Present() Spell(pet_water_jet)
 	#call_action_list,name=crystal_sequence,if=talent.prismatic_crystal.enabled&(cooldown.prismatic_crystal.remains<=gcd.max|pet.prismatic_crystal.active)
 	if Talent(prismatic_crystal_talent) and { SpellCooldown(prismatic_crystal) <= GCD() or TotemPresent(prismatic_crystal) } FrostCrystalSequenceShortCdActions()
 	#call_action_list,name=aoe,if=active_enemies>=4
@@ -766,29 +748,33 @@ AddFunction FrostDefaultCdActions
 {
 	#counterspell,if=target.debuff.casting.react
 	if target.IsInterruptible() InterruptActions()
-	#time_warp,if=target.health.pct<25|time>5
-	if { target.HealthPercent() < 25 or TimeInCombat() > 5 } and CheckBoxOn(opt_time_warp) and DebuffExpires(burst_haste_debuff any=1) Spell(time_warp)
-	#mirror_image
-	Spell(mirror_image)
-
-	unless BuffExpires(ice_floes_buff) and { 0 > 0 or 600 < CastTime(frostbolt) } and Spell(ice_floes)
-		or TotemRemaining(rune_of_power) < CastTime(rune_of_power) and Spell(rune_of_power)
-		or { SpellCooldown(icy_veins) < GCD() and TotemRemaining(rune_of_power) < 20 or { not Talent(prismatic_crystal_talent) or SpellCooldown(prismatic_crystal) < GCD() } and TotemRemaining(rune_of_power) < 10 } and Spell(rune_of_power)
+
+	unless 0 > 10 and Spell(blink)
 	{
-		#call_action_list,name=cooldowns,if=time_to_die<24
-		if TimeToDie() < 24 FrostCooldownsCdActions()
-		#call_action_list,name=crystal_sequence,if=talent.prismatic_crystal.enabled&(cooldown.prismatic_crystal.remains<=gcd.max|pet.prismatic_crystal.active)
-		if Talent(prismatic_crystal_talent) and { SpellCooldown(prismatic_crystal) <= GCD() or TotemPresent(prismatic_crystal) } FrostCrystalSequenceCdActions()
-		#call_action_list,name=aoe,if=active_enemies>=4
-		if Enemies() >= 4 FrostAoeCdActions()
-		#call_action_list,name=single_target
-		FrostSingleTargetCdActions()
+		#time_warp,if=target.health.pct<25|time>5
+		if { target.HealthPercent() < 25 or TimeInCombat() > 5 } and CheckBoxOn(opt_time_warp) and DebuffExpires(burst_haste_debuff any=1) Spell(time_warp)
+		#call_action_list,name=water_jet,if=prev.water_jet|debuff.water_jet.remains>0
+		if PreviousSpell(pet_water_jet) or target.DebuffRemaining(pet_water_jet_debuff) > 0 FrostWaterJetCdActions()
+		#mirror_image
+		Spell(mirror_image)
+
+		unless BuffExpires(ice_floes_buff) and { 0 > 0 or 600 < CastTime(frostbolt) } and Spell(ice_floes) or TotemRemaining(rune_of_power) < CastTime(rune_of_power) and Spell(rune_of_power) or { SpellCooldown(icy_veins) < GCD() and TotemRemaining(rune_of_power) < 20 or SpellCooldown(prismatic_crystal) < GCD() and TotemRemaining(rune_of_power) < 10 } and Spell(rune_of_power)
+		{
+			#call_action_list,name=cooldowns,if=time_to_die<24
+			if TimeToDie() < 24 FrostCooldownsCdActions()
+			#call_action_list,name=crystal_sequence,if=talent.prismatic_crystal.enabled&(cooldown.prismatic_crystal.remains<=gcd.max|pet.prismatic_crystal.active)
+			if Talent(prismatic_crystal_talent) and { SpellCooldown(prismatic_crystal) <= GCD() or TotemPresent(prismatic_crystal) } FrostCrystalSequenceCdActions()
+			#call_action_list,name=aoe,if=active_enemies>=4
+			if Enemies() >= 4 FrostAoeCdActions()
+			#call_action_list,name=single_target
+			FrostSingleTargetCdActions()
+		}
 	}
 }

-# ActionList: FrostAoeActions --> main, shortcd, cd
+### actions.aoe

-AddFunction FrostAoeActions
+AddFunction FrostAoeMainActions
 {
 	#frost_bomb,if=remains<action.ice_lance.travel_time&(cooldown.frozen_orb.remains<gcd.max|buff.fingers_of_frost.react=2)
 	if target.DebuffRemaining(frost_bomb_debuff) < MaxTravelTime(ice_lance) and { SpellCooldown(frozen_orb) < GCD() or BuffStacks(fingers_of_frost_buff) == 2 } Spell(frost_bomb)
@@ -821,7 +807,7 @@ AddFunction FrostAoeCdActions
 	FrostCooldownsCdActions()
 }

-# ActionList: FrostCooldownsActions --> cd
+### actions.cooldowns

 AddFunction FrostCooldownsCdActions
 {
@@ -837,9 +823,9 @@ AddFunction FrostCooldownsCdActions
 	if BuffPresent(burst_haste_buff any=1) or BuffPresent(icy_veins_buff) UsePotionIntellect()
 }

-# ActionList: FrostCrystalSequenceActions --> main, shortcd, cd
+### actions.crystal_sequence

-AddFunction FrostCrystalSequenceActions
+AddFunction FrostCrystalSequenceMainActions
 {
 	# CHANGE: Workaround possible bug in SimulationCraft APL.
 	#frost_bomb,if=active_enemies=1&current_target!=prismatic_crystal&remains<10
@@ -865,6 +851,7 @@ AddFunction FrostCrystalSequenceActions

 AddFunction FrostCrystalSequenceShortCdActions
 {
+	# CHANGE: Workaround possible bug in SimulationCraft APL.
 	unless Enemies() == 1 and not target.Name(prismatic_crystal) and target.DebuffRemaining(frost_bomb_debuff) < MaxTravelTime(ice_lance) and Spell(frost_bomb)
 	{
 		#frozen_orb
@@ -876,23 +863,43 @@ AddFunction FrostCrystalSequenceShortCdActions

 AddFunction FrostCrystalSequenceCdActions
 {
-	unless Enemies() == 1 and not target.Name(prismatic_crystal) and target.DebuffRemaining(frost_bomb_debuff) < MaxTravelTime(ice_lance) and Spell(frost_bomb)
-		or Spell(frozen_orb)
+	# CHANGE: Workaround possible bug in SimulationCraft APL.
+	unless Enemies() == 1 and not target.Name(prismatic_crystal) and target.DebuffRemaining(frost_bomb_debuff) < MaxTravelTime(ice_lance) and Spell(frost_bomb) or Spell(frozen_orb)
 	{
 		#call_action_list,name=cooldowns
 		FrostCooldownsCdActions()
 	}
 }

-# ActionList: FrostPrecombatActions --> main, shortcd, cd
+### actions.init_water_jet

-AddFunction FrostPrecombatActions
+AddFunction FrostInitWaterJetMainActions
+{
+	#frost_bomb,if=remains<3.6
+	if target.DebuffRemaining(frost_bomb_debuff) < 3.6 Spell(frost_bomb)
+	#ice_lance,if=buff.fingers_of_frost.react&pet.water_elemental.cooldown.water_jet.up
+	if BuffPresent(fingers_of_frost_buff) and not SpellCooldown(pet_water_jet) > 0 Spell(ice_lance)
+	#frostbolt
+	Spell(frostbolt)
+}
+
+AddFunction FrostInitWaterJetShortCdActions
+{
+	unless target.DebuffRemaining(frost_bomb_debuff) < 3.6 and Spell(frost_bomb) or BuffPresent(fingers_of_frost_buff) and not SpellCooldown(pet_water_jet) > 0 and Spell(ice_lance)
+	{
+		#water_jet,if=prev_gcd.frostbolt
+		if PreviousGCDSpell(frostbolt) and pet.Present() Spell(pet_water_jet)
+	}
+}
+
+### actions.precombat
+
+AddFunction FrostPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=calamari_crepes
 	#arcane_brilliance
 	if BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) Spell(arcane_brilliance)
-	#snapshot_stats
 	#frostbolt
 	Spell(frostbolt)
 }
@@ -903,6 +910,7 @@ AddFunction FrostPrecombatShortCdActions
 	{
 		#water_elemental
 		if not pet.Present() Spell(water_elemental)
+		#snapshot_stats
 		# CHANGE: Only suggest Rune of Power if the rune needs to be refreshed prior to pull.
 		#rune_of_power
 		#Spell(rune_of_power)
@@ -912,9 +920,7 @@ AddFunction FrostPrecombatShortCdActions

 AddFunction FrostPrecombatCdActions
 {
-	unless { BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) } and Spell(arcane_brilliance)
-		or not pet.Present() and Spell(water_elemental)
-		or TotemRemaining(rune_of_power) < 150 and Spell(rune_of_power)
+	unless { BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) } and Spell(arcane_brilliance) or not pet.Present() and Spell(water_elemental) or Spell(rune_of_power)
 	{
 		#mirror_image
 		Spell(mirror_image)
@@ -923,9 +929,9 @@ AddFunction FrostPrecombatCdActions
 	}
 }

-# ActionList: FrostSingleTargetActions --> main, shortcd, cd
+### actions.single_target

-AddFunction FrostSingleTargetActions
+AddFunction FrostSingleTargetMainActions
 {
 	#ice_lance,if=buff.fingers_of_frost.react&buff.fingers_of_frost.remains<action.frostbolt.execute_time
 	if BuffPresent(fingers_of_frost_buff) and BuffRemaining(fingers_of_frost_buff) < ExecuteTime(frostbolt) Spell(ice_lance)
@@ -953,6 +959,8 @@ AddFunction FrostSingleTargetActions
 	if ArmorSetBonus(T17 2) and BuffPresent(ice_shard_buff) and not { Talent(thermal_void_talent) and BuffPresent(icy_veins_buff) and BuffRemaining(icy_veins_buff) < 10 } Spell(frostbolt)
 	#ice_lance,if=!talent.frost_bomb.enabled&buff.fingers_of_frost.react&(!talent.thermal_void.enabled|cooldown.icy_veins.remains>8)
 	if not Talent(frost_bomb_talent) and BuffPresent(fingers_of_frost_buff) and { not Talent(thermal_void_talent) or SpellCooldown(icy_veins) > 8 } Spell(ice_lance)
+	#call_action_list,name=init_water_jet,if=pet.water_elemental.cooldown.water_jet.remains<=gcd.max*(buff.fingers_of_frost.react+talent.frost_bomb.enabled)&!dot.frozen_orb.ticking
+	if SpellCooldown(pet_water_jet) <= GCD() * { BuffStacks(fingers_of_frost_buff) + TalentPoints(frost_bomb_talent) } and not SpellCooldown(frozen_orb) > SpellCooldownDuration(frozen_orb) - 10 FrostInitWaterJetMainActions()
 	#frostbolt
 	Spell(frostbolt)
 	#ice_lance,moving=1
@@ -965,29 +973,21 @@ AddFunction FrostSingleTargetShortCdActions
 	if not pet.Present() Spell(water_elemental)
 	# CHANGE: Suggest pet's Freeze on non-worldboss targets to generate Fingers of Frost.
 	if not target.Classification(worldboss) and not BuffPresent(fingers_of_frost_buff) and pet.Present() Spell(pet_freeze)
-	unless BuffPresent(fingers_of_frost_buff) and BuffRemaining(fingers_of_frost_buff) < ExecuteTime(frostbolt) and Spell(ice_lance)
-		or BuffPresent(brain_freeze_buff) and BuffRemaining(brain_freeze_buff) < ExecuteTime(frostbolt) and Spell(frostfire_bolt)
-		or not Talent(prismatic_crystal_talent) and SpellCooldown(frozen_orb) < GCD() and target.DebuffRemaining(frost_bomb_debuff) < MaxTravelTime(ice_lance) and Spell(frost_bomb)
+	# CHANGE: Workaround possible bug in SimulationCraft APL.
+	unless BuffPresent(fingers_of_frost_buff) and BuffRemaining(fingers_of_frost_buff) < ExecuteTime(frostbolt) and Spell(ice_lance) or BuffPresent(brain_freeze_buff) and BuffRemaining(brain_freeze_buff) < ExecuteTime(frostbolt) and Spell(frostfire_bolt) or not Talent(prismatic_crystal_talent) and SpellCooldown(frozen_orb) < GCD() and target.DebuffRemaining(frost_bomb_debuff) < MaxTravelTime(ice_lance) and Spell(frost_bomb)
 	{
 		#frozen_orb,if=!talent.prismatic_crystal.enabled&buff.fingers_of_frost.stack<2&cooldown.icy_veins.remains>45
 		if not Talent(prismatic_crystal_talent) and BuffStacks(fingers_of_frost_buff) < 2 and SpellCooldown(icy_veins) > 45 Spell(frozen_orb)

-		unless target.DebuffRemaining(frost_bomb_debuff) < MaxTravelTime(ice_lance) and { BuffStacks(fingers_of_frost_buff) == 2 or BuffPresent(fingers_of_frost_buff) and { Talent(thermal_void_talent) or BuffRemaining(fingers_of_frost_buff) < GCD() * 2 } } and Spell(frost_bomb)
-			or { TimeToDie() < 10 or Charges(ice_nova) == 2 and { not Talent(prismatic_crystal_talent) or not { not SpellCooldown(prismatic_crystal) > 0 } } } and Spell(ice_nova)
-			or { BuffStacks(fingers_of_frost_buff) == 2 or BuffPresent(fingers_of_frost_buff) and SpellCooldown(frozen_orb) > SpellCooldownDuration(frozen_orb) - 10 } and Spell(ice_lance)
+		unless target.DebuffRemaining(frost_bomb_debuff) < MaxTravelTime(ice_lance) and { BuffStacks(fingers_of_frost_buff) == 2 or BuffPresent(fingers_of_frost_buff) and { Talent(thermal_void_talent) or BuffRemaining(fingers_of_frost_buff) < GCD() * 2 } } and Spell(frost_bomb) or { TimeToDie() < 10 or Charges(ice_nova) == 2 and { not Talent(prismatic_crystal_talent) or not { not SpellCooldown(prismatic_crystal) > 0 } } } and Spell(ice_nova) or { BuffStacks(fingers_of_frost_buff) == 2 or BuffPresent(fingers_of_frost_buff) and SpellCooldown(frozen_orb) > SpellCooldownDuration(frozen_orb) - 10 } and Spell(ice_lance)
 		{
 			#comet_storm
 			Spell(comet_storm)

-			unless { not Talent(prismatic_crystal_talent) or Charges(ice_nova) == 1 and SpellCooldown(prismatic_crystal) > SpellChargeCooldown(ice_nova) and BuffStacks(incanters_flow_buff) > 3 } and { BuffPresent(icy_veins_buff) or Charges(ice_nova) == 1 and SpellCooldown(icy_veins) > SpellChargeCooldown(ice_nova) } and Spell(ice_nova)
-				or BuffPresent(brain_freeze_buff) and Spell(frostfire_bolt)
-				or ArmorSetBonus(T17 4) and Talent(thermal_void_talent) and Talent(mirror_image_talent) and SpellCooldown(frozen_orb) > SpellCooldownDuration(frozen_orb) - 10 and Spell(ice_lance)
-				or Talent(frost_bomb_talent) and BuffPresent(fingers_of_frost_buff) and target.DebuffRemaining(frost_bomb_debuff) > MaxTravelTime(ice_lance) and { not Talent(thermal_void_talent) or SpellCooldown(icy_veins) > 8 } and Spell(ice_lance)
-				or ArmorSetBonus(T17 2) and BuffPresent(ice_shard_buff) and not { Talent(thermal_void_talent) and BuffPresent(icy_veins_buff) and BuffRemaining(icy_veins_buff) < 10 } and Spell(frostbolt)
-				or not Talent(frost_bomb_talent) and BuffPresent(fingers_of_frost_buff) and { not Talent(thermal_void_talent) or SpellCooldown(icy_veins) > 8 } and Spell(ice_lance)
+			unless { not Talent(prismatic_crystal_talent) or Charges(ice_nova) == 1 and SpellCooldown(prismatic_crystal) > SpellChargeCooldown(ice_nova) and BuffStacks(incanters_flow_buff) > 3 } and { BuffPresent(icy_veins_buff) or Charges(ice_nova) == 1 and SpellCooldown(icy_veins) > SpellChargeCooldown(ice_nova) } and Spell(ice_nova) or BuffPresent(brain_freeze_buff) and Spell(frostfire_bolt) or ArmorSetBonus(T17 4) and Talent(thermal_void_talent) and Talent(mirror_image_talent) and SpellCooldown(frozen_orb) > SpellCooldownDuration(frozen_orb) - 10 and Spell(ice_lance) or Talent(frost_bomb_talent) and BuffPresent(fingers_of_frost_buff) and target.DebuffRemaining(frost_bomb_debuff) > MaxTravelTime(ice_lance) and { not Talent(thermal_void_talent) or SpellCooldown(icy_veins) > 8 } and Spell(ice_lance) or ArmorSetBonus(T17 2) and BuffPresent(ice_shard_buff) and not { Talent(thermal_void_talent) and BuffPresent(icy_veins_buff) and BuffRemaining(icy_veins_buff) < 10 } and Spell(frostbolt) or not Talent(frost_bomb_talent) and BuffPresent(fingers_of_frost_buff) and { not Talent(thermal_void_talent) or SpellCooldown(icy_veins) > 8 } and Spell(ice_lance)
 			{
-				#water_jet,if=buff.fingers_of_frost.react=0&!dot.frozen_orb.ticking
-				if BuffStacks(fingers_of_frost_buff) == 0 and not SpellCooldown(frozen_orb) > SpellCooldownDuration(frozen_orb) - 10 and pet.Present() Spell(pet_water_jet)
+				#call_action_list,name=init_water_jet,if=pet.water_elemental.cooldown.water_jet.remains<=gcd.max*(buff.fingers_of_frost.react+talent.frost_bomb.enabled)&!dot.frozen_orb.ticking
+				if SpellCooldown(pet_water_jet) <= GCD() * { BuffStacks(fingers_of_frost_buff) + TalentPoints(frost_bomb_talent) } and not SpellCooldown(frozen_orb) > SpellCooldownDuration(frozen_orb) - 10 FrostInitWaterJetShortCdActions()
 			}
 		}
 	}
@@ -998,6 +998,38 @@ AddFunction FrostSingleTargetCdActions
 	#call_action_list,name=cooldowns,if=!talent.prismatic_crystal.enabled|cooldown.prismatic_crystal.remains>15
 	if not Talent(prismatic_crystal_talent) or SpellCooldown(prismatic_crystal) > 15 FrostCooldownsCdActions()
 }
+
+### actions.water_jet
+
+AddFunction FrostWaterJetMainActions
+{
+	#frostbolt,if=prev.water_jet
+	if PreviousSpell(pet_water_jet) Spell(frostbolt)
+	#ice_lance,if=buff.fingers_of_frost.react=2&action.frostbolt.in_flight
+	if BuffStacks(fingers_of_frost_buff) == 2 and InFlightToTarget(frostbolt) Spell(ice_lance)
+	#frostbolt,if=debuff.water_jet.remains>cast_time+travel_time
+	if target.DebuffRemaining(pet_water_jet_debuff) > CastTime(frostbolt) + MaxTravelTime(frostbolt) Spell(frostbolt)
+	#call_action_list,name=single_target
+	FrostSingleTargetMainActions()
+}
+
+AddFunction FrostWaterJetShortCdActions
+{
+	unless PreviousSpell(pet_water_jet) and Spell(frostbolt) or BuffStacks(fingers_of_frost_buff) == 2 and InFlightToTarget(frostbolt) and Spell(ice_lance) or target.DebuffRemaining(pet_water_jet_debuff) > CastTime(frostbolt) + MaxTravelTime(frostbolt) and Spell(frostbolt)
+	{
+		#call_action_list,name=single_target
+		FrostSingleTargetShortCdActions()
+	}
+}
+
+AddFunction FrostWaterJetCdActions
+{
+	unless PreviousSpell(pet_water_jet) and Spell(frostbolt) or BuffStacks(fingers_of_frost_buff) == 2 and InFlightToTarget(frostbolt) and Spell(ice_lance) or target.DebuffRemaining(pet_water_jet_debuff) > CastTime(frostbolt) + MaxTravelTime(frostbolt) and Spell(frostbolt)
+	{
+		#call_action_list,name=single_target
+		FrostSingleTargetCdActions()
+	}
+}
 ]]
 	OvaleScripts:RegisterScript("MAGE", name, desc, code, "include")
 end
@@ -1016,37 +1048,37 @@ AddCheckBox(opt_mage_arcane_aoe L(AOE) specialization=arcane default)

 AddIcon specialization=arcane help=shortcd enemies=1 checkbox=!opt_mage_arcane_aoe
 {
-	if InCombat(no) ArcanePrecombatShortCdActions()
+	if not InCombat() ArcanePrecombatShortCdActions()
 	ArcaneDefaultShortCdActions()
 }

 AddIcon specialization=arcane help=shortcd checkbox=opt_mage_arcane_aoe
 {
-	if InCombat(no) ArcanePrecombatShortCdActions()
+	if not InCombat() ArcanePrecombatShortCdActions()
 	ArcaneDefaultShortCdActions()
 }

 AddIcon specialization=arcane help=main enemies=1
 {
-	if InCombat(no) ArcanePrecombatActions()
-	ArcaneDefaultActions()
+	if not InCombat() ArcanePrecombatMainActions()
+	ArcaneDefaultMainActions()
 }

 AddIcon specialization=arcane help=aoe checkbox=opt_mage_arcane_aoe
 {
-	if InCombat(no) ArcanePrecombatActions()
-	ArcaneDefaultActions()
+	if not InCombat() ArcanePrecombatMainActions()
+	ArcaneDefaultMainActions()
 }

 AddIcon specialization=arcane help=cd enemies=1 checkbox=!opt_mage_arcane_aoe
 {
-	if InCombat(no) ArcanePrecombatCdActions()
+	if not InCombat() ArcanePrecombatCdActions()
 	ArcaneDefaultCdActions()
 }

 AddIcon specialization=arcane help=cd checkbox=opt_mage_arcane_aoe
 {
-	if InCombat(no) ArcanePrecombatCdActions()
+	if not InCombat() ArcanePrecombatCdActions()
 	ArcaneDefaultCdActions()
 }

@@ -1055,37 +1087,37 @@ AddCheckBox(opt_mage_fire_aoe L(AOE) specialization=fire default)

 AddIcon specialization=fire help=shortcd enemies=1 checkbox=!opt_mage_fire_aoe
 {
-	if InCombat(no) FirePrecombatShortCdActions()
+	if not InCombat() FirePrecombatShortCdActions()
 	FireDefaultShortCdActions()
 }

 AddIcon specialization=fire help=shortcd checkbox=opt_mage_fire_aoe
 {
-	if InCombat(no) FirePrecombatShortCdActions()
+	if not InCombat() FirePrecombatShortCdActions()
 	FireDefaultShortCdActions()
 }

 AddIcon specialization=fire help=main enemies=1
 {
-	if InCombat(no) FirePrecombatActions()
-	FireDefaultActions()
+	if not InCombat() FirePrecombatMainActions()
+	FireDefaultMainActions()
 }

 AddIcon specialization=fire help=aoe checkbox=opt_mage_fire_aoe
 {
-	if InCombat(no) FirePrecombatActions()
-	FireDefaultActions()
+	if not InCombat() FirePrecombatMainActions()
+	FireDefaultMainActions()
 }

 AddIcon specialization=fire help=cd enemies=1 checkbox=!opt_mage_fire_aoe
 {
-	if InCombat(no) FirePrecombatCdActions()
+	if not InCombat() FirePrecombatCdActions()
 	FireDefaultCdActions()
 }

 AddIcon specialization=fire help=cd checkbox=opt_mage_fire_aoe
 {
-	if InCombat(no) FirePrecombatCdActions()
+	if not InCombat() FirePrecombatCdActions()
 	FireDefaultCdActions()
 }

@@ -1094,37 +1126,37 @@ AddCheckBox(opt_mage_frost_aoe L(AOE) specialization=frost default)

 AddIcon specialization=frost help=shortcd enemies=1 checkbox=!opt_mage_frost_aoe
 {
-	if InCombat(no) FrostPrecombatShortCdActions()
+	if not InCombat() FrostPrecombatShortCdActions()
 	FrostDefaultShortCdActions()
 }

 AddIcon specialization=frost help=shortcd checkbox=opt_mage_frost_aoe
 {
-	if InCombat(no) FrostPrecombatShortCdActions()
+	if not InCombat() FrostPrecombatShortCdActions()
 	FrostDefaultShortCdActions()
 }

 AddIcon specialization=frost help=main enemies=1
 {
-	if InCombat(no) FrostPrecombatActions()
-	FrostDefaultActions()
+	if not InCombat() FrostPrecombatMainActions()
+	FrostDefaultMainActions()
 }

 AddIcon specialization=frost help=aoe checkbox=opt_mage_frost_aoe
 {
-	if InCombat(no) FrostPrecombatActions()
-	FrostDefaultActions()
+	if not InCombat() FrostPrecombatMainActions()
+	FrostDefaultMainActions()
 }

 AddIcon specialization=frost help=cd enemies=1 checkbox=!opt_mage_frost_aoe
 {
-	if InCombat(no) FrostPrecombatCdActions()
+	if not InCombat() FrostPrecombatCdActions()
 	FrostDefaultCdActions()
 }

 AddIcon specialization=frost help=cd checkbox=opt_mage_frost_aoe
 {
-	if InCombat(no) FrostPrecombatCdActions()
+	if not InCombat() FrostPrecombatCdActions()
 	FrostDefaultCdActions()
 }
 ]]
diff --git a/scripts/ovale_monk.lua b/scripts/ovale_monk.lua
index aa585b0..b2fb87c 100644
--- a/scripts/ovale_monk.lua
+++ b/scripts/ovale_monk.lua
@@ -10,7 +10,8 @@ do
 Include(ovale_common)
 Include(ovale_monk_spells)

-AddCheckBox(opt_potion_agility ItemName(draenic_agility_potion) default)
+AddCheckBox(opt_potion_agility ItemName(draenic_agility_potion) default specialization=windwalker)
+AddCheckBox(opt_potion_armor ItemName(draenic_armor_potion) default specialization=brewmaster)
 AddCheckBox(opt_chi_burst SpellName(chi_burst) default)

 AddFunction UsePotionAgility
@@ -18,6 +19,11 @@ AddFunction UsePotionAgility
 	if CheckBoxOn(opt_potion_agility) and target.Classification(worldboss) Item(draenic_agility_potion usable=1)
 }

+AddFunction UsePotionArmor
+{
+	if CheckBoxOn(opt_potion_armor) and target.Classification(worldboss) Item(draenic_armor_potion usable=1)
+}
+
 AddFunction InterruptActions
 {
 	if not target.IsFriend() and target.IsInterruptible()
@@ -36,34 +42,33 @@ AddFunction InterruptActions
 ###
 ### Brewmaster
 ###
-# Based on SimulationCraft profile "Monk_Brewmaster_1h_CE_T17M".
+# Based on SimulationCraft profile "Monk_Brewmaster_2h_Serenity_T17M".
 #	class=monk
 #	spec=brewmaster
-#	talents=0130222
+#	talents=2133123
 #	glyphs=fortifying_brew,expel_harm,fortuitous_spheres

-# ActionList: BrewmasterDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction BrewmasterDefaultActions
+AddFunction BrewmasterDefaultMainActions
 {
-	#auto_attack
-	#chi_brew,if=talent.chi_brew.enabled&chi.max-chi>=2&buff.elusive_brew_stacks.stack<=10
-	if Talent(chi_brew_talent) and MaxChi() - Chi() >= 2 and BuffStacks(elusive_brew_stacks_buff) <= 10 Spell(chi_brew)
-	#gift_of_the_ox,if=buff.gift_of_the_ox.react&incoming_damage_1500ms
+	#chi_sphere,if=talent.power_strikes.enabled&buff.chi_sphere.react&chi<4
+	#chi_brew,if=talent.chi_brew.enabled&chi.max-chi>=2&buff.elusive_brew_stacks.stack<=10&((charges=1&recharge_time<5)|charges=2|target.time_to_die<15)
+	if Talent(chi_brew_talent) and MaxChi() - Chi() >= 2 and BuffStacks(elusive_brew_stacks_buff) <= 10 and { Charges(chi_brew) == 1 and SpellChargeCooldown(chi_brew) < 5 or Charges(chi_brew) == 2 or target.TimeToDie() < 15 } Spell(chi_brew)
+	#chi_brew,if=(chi<1&stagger.heavy)|(chi<2&buff.shuffle.down)
+	if Chi() < 1 and DebuffPresent(heavy_stagger_debuff) or Chi() < 2 and BuffExpires(shuffle_buff) Spell(chi_brew)
 	#call_action_list,name=st,if=active_enemies<3
-	if Enemies() < 3 BrewmasterStActions()
+	if Enemies() < 3 BrewmasterStMainActions()
 	#call_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 BrewmasterAoeActions()
+	if Enemies() >= 3 BrewmasterAoeMainActions()
 }

 AddFunction BrewmasterDefaultShortCdActions
 {
-	#chi_brew,if=talent.chi_brew.enabled&chi.max-chi>=2&buff.elusive_brew_stacks.stack<=10
-	if Talent(chi_brew_talent) and MaxChi() - Chi() >= 2 and BuffStacks(elusive_brew_stacks_buff) <= 10 Spell(chi_brew)
 	#elusive_brew,if=buff.elusive_brew_stacks.react>=9&(buff.dampen_harm.down|buff.diffuse_magic.down)&buff.elusive_brew_activated.down
 	if BuffStacks(elusive_brew_stacks_buff) >= 9 and { BuffExpires(dampen_harm_buff) or BuffExpires(diffuse_magic_buff) } and BuffExpires(elusive_brew_activated_buff) Spell(elusive_brew)
-	#serenity,if=talent.serenity.enabled&energy<=40
-	if Talent(serenity_talent) and Energy() <= 40 Spell(serenity)
+	#serenity,if=talent.serenity.enabled&cooldown.keg_smash.remains>6
+	if Talent(serenity_talent) and SpellCooldown(keg_smash) > 6 Spell(serenity)
 	#call_action_list,name=st,if=active_enemies<3
 	if Enemies() < 3 BrewmasterStShortCdActions()
 	#call_action_list,name=aoe,if=active_enemies>=3
@@ -73,191 +78,164 @@ AddFunction BrewmasterDefaultShortCdActions
 AddFunction BrewmasterDefaultCdActions
 {
 	# CHANGE: Touch of Death if it will kill the mob.
-	if target.Health() < Health() and BuffPresent(death_note_buff) Spell(touch_of_death)
+	if { target.Health() < Health() or target.HealthPercent() < 10 } and BuffPresent(death_note_buff) Spell(touch_of_death)
 	# CHANGE: Add interrupt actions missing from SimulationCraft action list.
 	InterruptActions()
 	# CHANGE: Break snares with Nimble Brew.
 	if IsFeared() or IsRooted() or IsStunned() Spell(nimble_brew)
+	#auto_attack
 	#blood_fury,if=energy<=40
 	if Energy() <= 40 Spell(blood_fury_apsp)
 	#berserking,if=energy<=40
 	if Energy() <= 40 Spell(berserking)
 	#arcane_torrent,if=energy<=40
 	if Energy() <= 40 Spell(arcane_torrent_chi)
+	#gift_of_the_ox,if=buff.gift_of_the_ox.react&incoming_damage_1500ms
 	#diffuse_magic,if=incoming_damage_1500ms&buff.fortifying_brew.down
 	if IncomingDamage(1.5) > 0 and BuffExpires(fortifying_brew_buff) Spell(diffuse_magic)
 	#dampen_harm,if=incoming_damage_1500ms&buff.fortifying_brew.down&buff.elusive_brew_activated.down
-	if IncomingDamage(1.5) and BuffExpires(fortifying_brew_buff) and BuffExpires(elusive_brew_activated_buff) Spell(dampen_harm)
+	if IncomingDamage(1.5) > 0 and BuffExpires(fortifying_brew_buff) and BuffExpires(elusive_brew_activated_buff) Spell(dampen_harm)
 	#fortifying_brew,if=incoming_damage_1500ms&(buff.dampen_harm.down|buff.diffuse_magic.down)&buff.elusive_brew_activated.down
 	if IncomingDamage(1.5) > 0 and { BuffExpires(dampen_harm_buff) or BuffExpires(diffuse_magic_buff) } and BuffExpires(elusive_brew_activated_buff) Spell(fortifying_brew)
-	#invoke_xuen,if=talent.invoke_xuen.enabled&time>5
-	if Talent(invoke_xuen_talent) and TimeInCombat() > 5 Spell(invoke_xuen)
-	#call_action_list,name=st,if=active_enemies<3
-	if Enemies() < 3 BrewmasterStCdActions()
-	#call_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 BrewmasterAoeCdActions()
+	#invoke_xuen,if=talent.invoke_xuen.enabled&target.time_to_die>15&buff.shuffle.remains>=3&buff.serenity.down
+	if Talent(invoke_xuen_talent) and target.TimeToDie() > 15 and BuffRemaining(shuffle_buff) >= 3 and BuffExpires(serenity_buff) Spell(invoke_xuen)
+	#potion,name=draenic_armor,if=(buff.fortifying_brew.down&(buff.dampen_harm.down|buff.diffuse_magic.down)&buff.elusive_brew_activated.down)
+	if BuffExpires(fortifying_brew_buff) and { BuffExpires(dampen_harm_buff) or BuffExpires(diffuse_magic_buff) } and BuffExpires(elusive_brew_activated_buff) UsePotionArmor()
 }

-# ActionList: BrewmasterAoeActions --> main, shortcd, cd
+### actions.aoe

-AddFunction BrewmasterAoeActions
+AddFunction BrewmasterAoeMainActions
 {
-	# CHANGE: Ensure that Shuffle is never down.
+	#blackout_kick,if=buff.shuffle.down
 	if BuffExpires(shuffle_buff) Spell(blackout_kick)
-	#breath_of_fire,if=chi>=3&buff.shuffle.remains>=6&dot.breath_of_fire.remains<=gcd
-	if Chi() >= 3 and BuffRemaining(shuffle_buff) >= 6 and target.DebuffRemaining(breath_of_fire_debuff) <= GCD() Spell(breath_of_fire)
+	#breath_of_fire,if=(chi>=3|buff.serenity.up)&buff.shuffle.remains>=6&dot.breath_of_fire.remains<=2.4&!talent.chi_explosion.enabled
+	if { Chi() >= 3 or BuffPresent(serenity_buff) } and BuffRemaining(shuffle_buff) >= 6 and target.DebuffRemaining(breath_of_fire_debuff) <= 2.4 and not Talent(chi_explosion_talent) Spell(breath_of_fire)
+	#keg_smash,if=chi.max-chi>=1&!buff.serenity.remains
+	if MaxChi() - Chi() >= 1 and not BuffPresent(serenity_buff) Spell(keg_smash)
+	#rushing_jade_wind,if=chi.max-chi>=1&!buff.serenity.remains&talent.rushing_jade_wind.enabled
+	if MaxChi() - Chi() >= 1 and not BuffPresent(serenity_buff) and Talent(rushing_jade_wind_talent) Spell(rushing_jade_wind)
+	#chi_wave,if=(energy+(energy.regen*gcd))<100
+	if Energy() + EnergyRegenRate() * GCD() < 100 Spell(chi_wave)
+	#zen_sphere,cycle_targets=1,if=talent.zen_sphere.enabled&!dot.zen_sphere.ticking&(energy+(energy.regen*gcd))<100
+	if Talent(zen_sphere_talent) and not BuffPresent(zen_sphere_buff) and Energy() + EnergyRegenRate() * GCD() < 100 Spell(zen_sphere)
 	#chi_explosion,if=chi>=4
 	if Chi() >= 4 Spell(chi_explosion_tank)
-	#rushing_jade_wind,if=chi.max-chi>=1&talent.rushing_jade_wind.enabled
-	if MaxChi() - Chi() >= 1 and Talent(rushing_jade_wind_talent) Spell(rushing_jade_wind)
-	#keg_smash,if=chi.max-chi>=2&!buff.serenity.remains
-	if MaxChi() - Chi() >= 2 and not BuffPresent(serenity_buff) Spell(keg_smash)
-	#chi_burst,if=talent.chi_burst.enabled&energy.time_to_max>3
-	if Talent(chi_burst_talent) and TimeToMaxEnergy() > 3 and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
-	#chi_wave,if=talent.chi_wave.enabled&energy.time_to_max>3
-	if Talent(chi_wave_talent) and TimeToMaxEnergy() > 3 Spell(chi_wave)
-	#zen_sphere,cycle_targets=1,if=talent.zen_sphere.enabled&!dot.zen_sphere.ticking
-	if Talent(zen_sphere_talent) and not BuffPresent(zen_sphere_buff) Spell(zen_sphere)
-	#blackout_kick,if=talent.rushing_jade_wind.enabled&buff.shuffle.remains<=3&cooldown.keg_smash.remains>=gcd
-	if Talent(rushing_jade_wind_talent) and BuffRemaining(shuffle_buff) <= 3 and SpellCooldown(keg_smash) >= GCD() Spell(blackout_kick)
-	#blackout_kick,if=talent.rushing_jade_wind.enabled&buff.serenity.up
-	if Talent(rushing_jade_wind_talent) and BuffPresent(serenity_buff) Spell(blackout_kick)
-	#blackout_kick,if=talent.rushing_jade_wind.enabled&chi>=4
-	if Talent(rushing_jade_wind_talent) and Chi() >= 4 Spell(blackout_kick)
-	#expel_harm,if=chi.max-chi>=1&cooldown.keg_smash.remains>=gcd&(energy+(energy.regen*(cooldown.keg_smash.remains)))>=40
-	if MaxChi() - Chi() >= 1 and SpellCooldown(keg_smash) >= GCD() and Energy() + EnergyRegenRate() * SpellCooldown(keg_smash) >= 40 Spell(expel_harm)
-	#spinning_crane_kick,if=chi.max-chi>=1&!talent.rushing_jade_wind.enabled
-	if MaxChi() - Chi() >= 1 and not Talent(rushing_jade_wind_talent) Spell(spinning_crane_kick)
-	#jab,if=talent.rushing_jade_wind.enabled&chi.max-chi>=1&cooldown.keg_smash.remains>=gcd&cooldown.expel_harm.remains>=gcd
-	if Talent(rushing_jade_wind_talent) and MaxChi() - Chi() >= 1 and SpellCooldown(keg_smash) >= GCD() and SpellCooldown(expel_harm) >= GCD() Spell(jab)
-	#tiger_palm,if=talent.rushing_jade_wind.enabled&(energy+(energy.regen*(cooldown.keg_smash.remains)))>=40
-	if Talent(rushing_jade_wind_talent) and Energy() + EnergyRegenRate() * SpellCooldown(keg_smash) >= 40 Spell(tiger_palm)
-	#tiger_palm,if=talent.rushing_jade_wind.enabled&cooldown.keg_smash.remains>=gcd
-	if Talent(rushing_jade_wind_talent) and SpellCooldown(keg_smash) >= GCD() Spell(tiger_palm)
+	#blackout_kick,if=chi>=4
+	if Chi() >= 4 Spell(blackout_kick)
+	#blackout_kick,if=buff.shuffle.remains<=3&cooldown.keg_smash.remains>=gcd
+	if BuffRemaining(shuffle_buff) <= 3 and SpellCooldown(keg_smash) >= GCD() Spell(blackout_kick)
+	#blackout_kick,if=buff.serenity.up
+	if BuffPresent(serenity_buff) Spell(blackout_kick)
+	#expel_harm,if=chi.max-chi>=1&cooldown.keg_smash.remains>=gcd&(energy+(energy.regen*(cooldown.keg_smash.remains)))>=80
+	if MaxChi() - Chi() >= 1 and SpellCooldown(keg_smash) >= GCD() and Energy() + EnergyRegenRate() * SpellCooldown(keg_smash) >= 80 Spell(expel_harm)
+	#jab,if=chi.max-chi>=1&cooldown.keg_smash.remains>=gcd&cooldown.expel_harm.remains>=gcd&(energy+(energy.regen*(cooldown.keg_smash.remains)))>=80
+	if MaxChi() - Chi() >= 1 and SpellCooldown(keg_smash) >= GCD() and SpellCooldown(expel_harm) >= GCD() and Energy() + EnergyRegenRate() * SpellCooldown(keg_smash) >= 80 Spell(jab)
+	#tiger_palm
+	Spell(tiger_palm)
 }

 AddFunction BrewmasterAoeShortCdActions
 {
-	#guard
-	Spell(guard)
+	#purifying_brew,if=stagger.heavy
+	if DebuffPresent(heavy_stagger_debuff) Spell(purifying_brew)

-	unless Chi() >= 3 and BuffRemaining(shuffle_buff) >= 6 and target.DebuffRemaining(breath_of_fire_debuff) <= 1 and target.DebuffPresent(dizzying_haze_debuff) and Spell(breath_of_fire)
-		or Chi() >= 4 and Spell(chi_explosion_tank)
-		or MaxChi() - Chi() >= 1 and Talent(rushing_jade_wind_talent) and Spell(rushing_jade_wind)
+	unless BuffExpires(shuffle_buff) and Spell(blackout_kick)
 	{
-		#purifying_brew,if=!talent.chi_explosion.enabled&stagger.heavy
-		if not Talent(chi_explosion_talent) and DebuffPresent(heavy_stagger_debuff) Spell(purifying_brew)
-		#guard
-		Spell(guard)
-
-		unless MaxChi() - Chi() >= 2 and not BuffPresent(serenity_buff) and Spell(keg_smash)
-			or Talent(chi_burst_talent) and TimeToMaxEnergy() > 3 and CheckBoxOn(opt_chi_burst) and Spell(chi_burst)
-			or Talent(chi_wave_talent) and TimeToMaxEnergy() > 3 and Spell(chi_wave)
-			or Talent(zen_sphere_talent) and not BuffPresent(zen_sphere_buff) and Spell(zen_sphere)
-			or Talent(rushing_jade_wind_talent) and BuffRemaining(shuffle_buff) <= 3 and SpellCooldown(keg_smash) >= GCD() and Spell(blackout_kick)
-			or Talent(rushing_jade_wind_talent) and BuffPresent(serenity_buff) and Spell(blackout_kick)
-			or Talent(rushing_jade_wind_talent) and Chi() >= 4 and Spell(blackout_kick)
-			or MaxChi() - Chi() >= 1 and SpellCooldown(keg_smash) >= GCD() and Energy() + EnergyRegenRate() * SpellCooldown(keg_smash) >= 40 and Spell(expel_harm)
-			or MaxChi() - Chi() >= 1 and not Talent(rushing_jade_wind_talent) and Spell(spinning_crane_kick)
-			or Talent(rushing_jade_wind_talent) and MaxChi() - Chi() >= 1 and SpellCooldown(keg_smash) >= GCD() and SpellCooldown(expel_harm) >= GCD() and Spell(jab)
+		#purifying_brew,if=buff.serenity.up
+		if BuffPresent(serenity_buff) Spell(purifying_brew)
+		#purifying_brew,if=!talent.chi_explosion.enabled&stagger.moderate&buff.shuffle.remains>=6
+		if not Talent(chi_explosion_talent) and DebuffPresent(moderate_stagger_debuff) and BuffRemaining(shuffle_buff) >= 6 Spell(purifying_brew)
+		#guard,if=(charges=1&recharge_time<5)|charges=2|target.time_to_die<15
+		if Charges(guard) == 1 and SpellChargeCooldown(guard) < 5 or Charges(guard) == 2 or target.TimeToDie() < 15 Spell(guard)
+		#guard,if=incoming_damage_10s>=health.max*0.5
+		if IncomingDamage(10) >= MaxHealth() * 0.5 Spell(guard)
+
+		unless { Chi() >= 3 or BuffPresent(serenity_buff) } and BuffRemaining(shuffle_buff) >= 6 and target.DebuffRemaining(breath_of_fire_debuff) <= 2.4 and not Talent(chi_explosion_talent) and Spell(breath_of_fire) or MaxChi() - Chi() >= 1 and not BuffPresent(serenity_buff) and Spell(keg_smash) or MaxChi() - Chi() >= 1 and not BuffPresent(serenity_buff) and Talent(rushing_jade_wind_talent) and Spell(rushing_jade_wind)
 		{
-			#purifying_brew,if=!talent.chi_explosion.enabled&talent.rushing_jade_wind.enabled&stagger.moderate&buff.shuffle.remains>=6
-			if not Talent(chi_explosion_talent) and Talent(rushing_jade_wind_talent) and DebuffPresent(moderate_stagger_debuff) and BuffRemaining(shuffle_buff) >= 6 Spell(purifying_brew)
+			#chi_burst,if=(energy+(energy.regen*gcd))<100
+			if Energy() + EnergyRegenRate() * GCD() < 100 and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
 		}
 	}
 }

-AddFunction BrewmasterAoeCdActions {}
+### actions.precombat

-# ActionList: BrewmasterPrecombatActions --> main, shortcd, cd
-
-AddFunction BrewmasterPrecombatActions
+AddFunction BrewmasterPrecombatMainActions
 {
 	#flask,type=greater_draenic_stamina_flask
-	#food,type=sleeper_surprise
-	# CHANGE: Buff with Legacy of the White Tiger
+	#food,type=talador_surf_and_turf
+	# CHANGE: Buff with Legacy of the White Tiger.
 	if BuffExpires(str_agi_int_buff any=1) Spell(legacy_of_the_white_tiger)
 	#stance,choose=sturdy_ox
 	Spell(stance_of_the_sturdy_ox)
-	#snapshot_stats
 }

-AddFunction BrewmasterPrecombatShortCdActions {}
-
 AddFunction BrewmasterPrecombatCdActions
 {
-	unless BuffExpires(str_agi_int_buff any=1) and Spell(legacy_of_the_white_tiger)
-		or Spell(stance_of_the_sturdy_ox)
+	# CHANGE: Buff with Legacy of the White Tiger.
+	unless BuffExpires(str_agi_int_buff any=1) and Spell(legacy_of_the_white_tiger) or Spell(stance_of_the_sturdy_ox)
 	{
-		#potion,name=draenic_agility
-		UsePotionAgility()
+		#snapshot_stats
+		#potion,name=draenic_armor
+		UsePotionArmor()
 		#dampen_harm
 		Spell(dampen_harm)
 	}
 }

-# ActionList: BrewmasterStActions --> main, shortcd, cd
+### actions.st

-AddFunction BrewmasterStActions
+AddFunction BrewmasterStMainActions
 {
 	#blackout_kick,if=buff.shuffle.down
 	if BuffExpires(shuffle_buff) Spell(blackout_kick)
-	#keg_smash,if=chi.max-chi>=2&!buff.serenity.remains
-	if MaxChi() - Chi() >= 2 and not BuffPresent(serenity_buff) Spell(keg_smash)
-	#chi_burst,if=talent.chi_burst.enabled&energy.time_to_max>3
-	if Talent(chi_burst_talent) and TimeToMaxEnergy() > 3 and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
-	#chi_wave,if=talent.chi_wave.enabled&energy.time_to_max>3
-	if Talent(chi_wave_talent) and TimeToMaxEnergy() > 3 Spell(chi_wave)
-	#zen_sphere,cycle_targets=1,if=talent.zen_sphere.enabled&!dot.zen_sphere.ticking
-	if Talent(zen_sphere_talent) and not BuffPresent(zen_sphere_buff) Spell(zen_sphere)
+	#keg_smash,if=chi.max-chi>=1&!buff.serenity.remains
+	if MaxChi() - Chi() >= 1 and not BuffPresent(serenity_buff) Spell(keg_smash)
+	#chi_wave,if=(energy+(energy.regen*gcd))<100
+	if Energy() + EnergyRegenRate() * GCD() < 100 Spell(chi_wave)
+	#zen_sphere,cycle_targets=1,if=talent.zen_sphere.enabled&!dot.zen_sphere.ticking&(energy+(energy.regen*gcd))<100
+	if Talent(zen_sphere_talent) and not BuffPresent(zen_sphere_buff) and Energy() + EnergyRegenRate() * GCD() < 100 Spell(zen_sphere)
 	#chi_explosion,if=chi>=3
 	if Chi() >= 3 Spell(chi_explosion_tank)
+	#blackout_kick,if=chi>=4
+	if Chi() >= 4 Spell(blackout_kick)
 	#blackout_kick,if=buff.shuffle.remains<=3&cooldown.keg_smash.remains>=gcd
 	if BuffRemaining(shuffle_buff) <= 3 and SpellCooldown(keg_smash) >= GCD() Spell(blackout_kick)
 	#blackout_kick,if=buff.serenity.up
 	if BuffPresent(serenity_buff) Spell(blackout_kick)
-	#blackout_kick,if=chi>=4
-	if Chi() >= 4 Spell(blackout_kick)
-	#expel_harm,if=chi.max-chi>=1&cooldown.keg_smash.remains>=gcd
-	if MaxChi() - Chi() >= 1 and SpellCooldown(keg_smash) >= GCD() Spell(expel_harm)
-	#jab,if=chi.max-chi>=1&cooldown.keg_smash.remains>=gcd&cooldown.expel_harm.remains>=gcd
-	if MaxChi() - Chi() >= 1 and SpellCooldown(keg_smash) >= GCD() and SpellCooldown(expel_harm) >= GCD() Spell(jab)
-	#tiger_palm,if=(energy+(energy.regen*(cooldown.keg_smash.remains)))>=40
-	if Energy() + EnergyRegenRate() * SpellCooldown(keg_smash) >= 40 Spell(tiger_palm)
-	#tiger_palm,if=cooldown.keg_smash.remains>=gcd
-	if SpellCooldown(keg_smash) >= GCD() Spell(tiger_palm)
+	#expel_harm,if=chi.max-chi>=1&cooldown.keg_smash.remains>=gcd&(energy+(energy.regen*(cooldown.keg_smash.remains)))>=80
+	if MaxChi() - Chi() >= 1 and SpellCooldown(keg_smash) >= GCD() and Energy() + EnergyRegenRate() * SpellCooldown(keg_smash) >= 80 Spell(expel_harm)
+	#jab,if=chi.max-chi>=1&cooldown.keg_smash.remains>=gcd&cooldown.expel_harm.remains>=gcd&(energy+(energy.regen*(cooldown.keg_smash.remains)))>=80
+	if MaxChi() - Chi() >= 1 and SpellCooldown(keg_smash) >= GCD() and SpellCooldown(expel_harm) >= GCD() and Energy() + EnergyRegenRate() * SpellCooldown(keg_smash) >= 80 Spell(jab)
+	#tiger_palm
+	Spell(tiger_palm)
 }

 AddFunction BrewmasterStShortCdActions
 {
+	#purifying_brew,if=!talent.chi_explosion.enabled&stagger.heavy
+	if not Talent(chi_explosion_talent) and DebuffPresent(heavy_stagger_debuff) Spell(purifying_brew)
+
 	unless BuffExpires(shuffle_buff) and Spell(blackout_kick)
 	{
-		#purifying_brew,if=!talent.chi_explosion.enabled&stagger.heavy
-		if not Talent(chi_explosion_talent) and DebuffPresent(heavy_stagger_debuff) Spell(purifying_brew)
 		#purifying_brew,if=buff.serenity.up
 		if BuffPresent(serenity_buff) Spell(purifying_brew)
-		#guard
-		Spell(guard)
-
-		unless MaxChi() - Chi() >= 2 and not BuffPresent(serenity_buff) and Spell(keg_smash)
-			or Talent(chi_burst_talent) and TimeToMaxEnergy() > 3 and CheckBoxOn(opt_chi_burst) and Spell(chi_burst)
-			or Talent(chi_wave_talent) and TimeToMaxEnergy() > 3 and Spell(chi_wave)
-			or Talent(zen_sphere_talent) and not BuffPresent(zen_sphere_buff) and Spell(zen_sphere)
-			or Chi() >= 3 and Spell(chi_explosion_tank)
-			or BuffRemaining(shuffle_buff) <= 3 and SpellCooldown(keg_smash) >= GCD() and Spell(blackout_kick)
-			or BuffPresent(serenity_buff) and Spell(blackout_kick)
-			or Chi() >= 4 and Spell(blackout_kick)
-			or MaxChi() - Chi() >= 1 and SpellCooldown(keg_smash) >= GCD() and Spell(expel_harm)
-			or MaxChi() - Chi() >= 1 and SpellCooldown(keg_smash) >= GCD() and SpellCooldown(expel_harm) >= GCD() and Spell(jab)
+		#purifying_brew,if=!talent.chi_explosion.enabled&stagger.moderate&buff.shuffle.remains>=6
+		if not Talent(chi_explosion_talent) and DebuffPresent(moderate_stagger_debuff) and BuffRemaining(shuffle_buff) >= 6 Spell(purifying_brew)
+		#guard,if=(charges=1&recharge_time<5)|charges=2|target.time_to_die<15
+		if Charges(guard) == 1 and SpellChargeCooldown(guard) < 5 or Charges(guard) == 2 or target.TimeToDie() < 15 Spell(guard)
+		#guard,if=incoming_damage_10s>=health.max*0.5
+		if IncomingDamage(10) >= MaxHealth() * 0.5 Spell(guard)
+
+		unless MaxChi() - Chi() >= 1 and not BuffPresent(serenity_buff) and Spell(keg_smash)
 		{
-			#purifying_brew,if=!talent.chi_explosion.enabled&stagger.moderate&buff.shuffle.remains>=6
-			if not Talent(chi_explosion_talent) and DebuffPresent(moderate_stagger_debuff) and BuffRemaining(shuffle_buff) >= 6 Spell(purifying_brew)
+			#chi_burst,if=(energy+(energy.regen*gcd))<100
+			if Energy() + EnergyRegenRate() * GCD() < 100 and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
 		}
 	}
 }

-AddFunction BrewmasterStCdActions {}
-
 ###
 ### Windwalker
 ###
@@ -266,11 +244,10 @@ AddFunction BrewmasterStCdActions {}
 #	spec=windwalker
 #	talents=0130023

-# ActionList: WindwalkerDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction WindwalkerDefaultActions
+AddFunction WindwalkerDefaultMainActions
 {
-	#auto_attack
 	#chi_brew,if=chi.max-chi>=2&((charges=1&recharge_time<=10)|charges=2|target.time_to_die<charges*10)&buff.tigereye_brew.stack<=16
 	if MaxChi() - Chi() >= 2 and { Charges(chi_brew) == 1 and SpellChargeCooldown(chi_brew) <= 10 or Charges(chi_brew) == 2 or target.TimeToDie() < Charges(chi_brew) * 10 } and BuffStacks(tigereye_brew_buff) <= 16 Spell(chi_brew)
 	#tiger_palm,if=buff.tiger_power.remains<=3
@@ -280,9 +257,9 @@ AddFunction WindwalkerDefaultActions
 	#tiger_palm,if=buff.tiger_power.down&debuff.rising_sun_kick.remains>1&energy.time_to_max>1
 	if BuffExpires(tiger_power_buff) and target.DebuffRemaining(rising_sun_kick_debuff) > 1 and TimeToMaxEnergy() > 1 Spell(tiger_palm)
 	#call_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 WindwalkerAoeActions()
+	if Enemies() >= 3 WindwalkerAoeMainActions()
 	#call_action_list,name=st,if=active_enemies<3
-	if Enemies() < 3 WindwalkerStActions()
+	if Enemies() < 3 WindwalkerStMainActions()
 }

 AddFunction WindwalkerDefaultShortCdActions
@@ -300,8 +277,7 @@ AddFunction WindwalkerDefaultShortCdActions
 		#tigereye_brew,if=buff.tigereye_brew_use.down&chi>=2&(buff.tigereye_brew.stack>=16|target.time_to_die<40)&debuff.rising_sun_kick.up&buff.tiger_power.up
 		if BuffExpires(tigereye_brew_use_buff) and Chi() >= 2 and { BuffStacks(tigereye_brew_buff) >= 16 or target.TimeToDie() < 40 } and target.DebuffPresent(rising_sun_kick_debuff) and BuffPresent(tiger_power_buff) Spell(tigereye_brew)

-		unless { target.DebuffExpires(rising_sun_kick_debuff) or target.DebuffRemaining(rising_sun_kick_debuff) < 3 } and Spell(rising_sun_kick)
-			or BuffExpires(tiger_power_buff) and target.DebuffRemaining(rising_sun_kick_debuff) > 1 and TimeToMaxEnergy() > 1 and Spell(tiger_palm)
+		unless { target.DebuffExpires(rising_sun_kick_debuff) or target.DebuffRemaining(rising_sun_kick_debuff) < 3 } and Spell(rising_sun_kick) or BuffExpires(tiger_power_buff) and target.DebuffRemaining(rising_sun_kick_debuff) > 1 and TimeToMaxEnergy() > 1 and Spell(tiger_palm)
 		{
 			#serenity,if=talent.serenity.enabled&chi>=2&buff.tiger_power.up&debuff.rising_sun_kick.up
 			if Talent(serenity_talent) and Chi() >= 2 and BuffPresent(tiger_power_buff) and target.DebuffPresent(rising_sun_kick_debuff) Spell(serenity)
@@ -315,13 +291,14 @@ AddFunction WindwalkerDefaultShortCdActions

 AddFunction WindwalkerDefaultCdActions
 {
-	# CHANGE: Touch of Death if it will kill the mob.
-	if target.Health() < Health() and BuffPresent(death_note_buff) Spell(touch_of_death)
 	# CHANGE: Add interrupt actions missing from SimulationCraft action list.
 	InterruptActions()
 	# CHANGE: Break snares with Nimble Brew.
+	if IsFeared() or IsRooted() or IsStunned() Spell(nimble_brew)
+	#auto_attack
 	#invoke_xuen,if=talent.invoke_xuen.enabled&time>5
 	if Talent(invoke_xuen_talent) and TimeInCombat() > 5 Spell(invoke_xuen)
+	#chi_sphere,if=talent.power_strikes.enabled&buff.chi_sphere.react&chi<4
 	#potion,name=draenic_agility,if=buff.serenity.up|(!talent.serenity.enabled&trinket.proc.agility.react)
 	if BuffPresent(serenity_buff) or not Talent(serenity_talent) and BuffPresent(trinket_proc_agility_buff) UsePotionAgility()
 	#blood_fury,if=buff.tigereye_brew_use.up|target.time_to_die<18
@@ -331,9 +308,7 @@ AddFunction WindwalkerDefaultCdActions
 	#arcane_torrent,if=chi.max-chi>=1&(buff.tigereye_brew_use.up|target.time_to_die<18)
 	if MaxChi() - Chi() >= 1 and { BuffPresent(tigereye_brew_use_buff) or target.TimeToDie() < 18 } Spell(arcane_torrent_chi)

-	unless BuffRemaining(tiger_power_buff) <= 3 and Spell(tiger_palm)
-		or { target.DebuffExpires(rising_sun_kick_debuff) or target.DebuffRemaining(rising_sun_kick_debuff) < 3 } and Spell(rising_sun_kick)
-		or BuffExpires(tiger_power_buff) and target.DebuffRemaining(rising_sun_kick_debuff) > 1 and TimeToMaxEnergy() > 1 and Spell(tiger_palm)
+	unless BuffRemaining(tiger_power_buff) <= 3 and Spell(tiger_palm) or { target.DebuffExpires(rising_sun_kick_debuff) or target.DebuffRemaining(rising_sun_kick_debuff) < 3 } and Spell(rising_sun_kick) or BuffExpires(tiger_power_buff) and target.DebuffRemaining(rising_sun_kick_debuff) > 1 and TimeToMaxEnergy() > 1 and Spell(tiger_palm)
 	{
 		#call_action_list,name=aoe,if=active_enemies>=3
 		if Enemies() >= 3 WindwalkerAoeCdActions()
@@ -342,12 +317,12 @@ AddFunction WindwalkerDefaultCdActions
 	}
 }

-# ActionList: WindwalkerAoeActions --> main, shortcd, cd
+### actions.aoe

-AddFunction WindwalkerAoeActions
+AddFunction WindwalkerAoeMainActions
 {
-	#chi_explosion,if=chi>=4
-	if Chi() >= 4 Spell(chi_explosion_melee)
+	#chi_explosion,if=chi>=4&(cooldown.fists_of_fury.remains>3|!talent.rushing_jade_wind.enabled)
+	if Chi() >= 4 and { SpellCooldown(fists_of_fury) > 3 or not Talent(rushing_jade_wind_talent) } Spell(chi_explosion_melee)
 	#rushing_jade_wind
 	Spell(rushing_jade_wind)
 	#rising_sun_kick,if=!talent.rushing_jade_wind.enabled&chi=chi.max
@@ -356,80 +331,91 @@ AddFunction WindwalkerAoeActions
 	if not BuffPresent(zen_sphere_buff) Spell(zen_sphere)
 	#chi_wave,if=energy.time_to_max>2&buff.serenity.down
 	if TimeToMaxEnergy() > 2 and BuffExpires(serenity_buff) Spell(chi_wave)
-	#chi_burst,if=talent.chi_burst.enabled&energy.time_to_max>2&buff.serenity.down
-	if Talent(chi_burst_talent) and TimeToMaxEnergy() > 2 and BuffExpires(serenity_buff) and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
 	#blackout_kick,if=talent.rushing_jade_wind.enabled&!talent.chi_explosion.enabled&(buff.combo_breaker_bok.react|buff.serenity.up)
 	if Talent(rushing_jade_wind_talent) and not Talent(chi_explosion_talent) and { BuffPresent(combo_breaker_bok_buff) or BuffPresent(serenity_buff) } Spell(blackout_kick)
 	#tiger_palm,if=talent.rushing_jade_wind.enabled&buff.combo_breaker_tp.react&buff.combo_breaker_tp.remains<=2
 	if Talent(rushing_jade_wind_talent) and BuffPresent(combo_breaker_tp_buff) and BuffRemaining(combo_breaker_tp_buff) <= 2 Spell(tiger_palm)
-	#blackout_kick,if=talent.rushing_jade_wind.enabled&!talent.chi_explosion.enabled&chi.max-chi<2
-	if Talent(rushing_jade_wind_talent) and not Talent(chi_explosion_talent) and MaxChi() - Chi() < 2 Spell(blackout_kick)
+	#blackout_kick,if=talent.rushing_jade_wind.enabled&!talent.chi_explosion.enabled&chi.max-chi<2&(cooldown.fists_of_fury.remains>3|!talent.rushing_jade_wind.enabled)
+	if Talent(rushing_jade_wind_talent) and not Talent(chi_explosion_talent) and MaxChi() - Chi() < 2 and { SpellCooldown(fists_of_fury) > 3 or not Talent(rushing_jade_wind_talent) } Spell(blackout_kick)
 	#spinning_crane_kick,if=!talent.rushing_jade_wind.enabled
 	if not Talent(rushing_jade_wind_talent) Spell(spinning_crane_kick)
 	#jab,if=talent.rushing_jade_wind.enabled&chi.max-chi>=2
 	if Talent(rushing_jade_wind_talent) and MaxChi() - Chi() >= 2 Spell(jab)
+	#jab,if=talent.rushing_jade_wind.enabled&chi.max-chi>=1&talent.chi_explosion.enabled&cooldown.fists_of_fury.remains<=3
+	if Talent(rushing_jade_wind_talent) and MaxChi() - Chi() >= 1 and Talent(chi_explosion_talent) and SpellCooldown(fists_of_fury) <= 3 Spell(jab)
 }

 AddFunction WindwalkerAoeShortCdActions
 {
-	unless Chi() >= 4 and Spell(chi_explosion_melee)
-		or Spell(rushing_jade_wind)
-		or not Talent(rushing_jade_wind_talent) and Chi() == MaxChi() and Spell(rising_sun_kick)
+	unless Chi() >= 4 and { SpellCooldown(fists_of_fury) > 3 or not Talent(rushing_jade_wind_talent) } and Spell(chi_explosion_melee) or Spell(rushing_jade_wind)
 	{
-		#fists_of_fury,if=talent.rushing_jade_wind.enabled&energy.time_to_max>cast_time&buff.tiger_power.remains>cast_time&debuff.rising_sun_kick.remains>cast_time&!buff.serenity.remains
-		if Talent(rushing_jade_wind_talent) and TimeToMaxEnergy() > CastTime(fists_of_fury) and BuffRemaining(tiger_power_buff) > CastTime(fists_of_fury) and target.DebuffRemaining(rising_sun_kick_debuff) > CastTime(fists_of_fury) and not BuffPresent(serenity_buff) Spell(fists_of_fury)
-		#touch_of_death,if=target.health.percent<10
-		if target.HealthPercent() < 10 and BuffPresent(death_note_buff) Spell(touch_of_death)
-		#hurricane_strike,if=talent.rushing_jade_wind.enabled&talent.hurricane_strike.enabled&energy.time_to_max>cast_time&buff.tiger_power.remains>cast_time&debuff.rising_sun_kick.remains>cast_time&buff.energizing_brew.down
-		if Talent(rushing_jade_wind_talent) and Talent(hurricane_strike_talent) and TimeToMaxEnergy() > CastTime(hurricane_strike) and BuffRemaining(tiger_power_buff) > CastTime(hurricane_strike) and target.DebuffRemaining(rising_sun_kick_debuff) > CastTime(hurricane_strike) and BuffExpires(energizing_brew_buff) Spell(hurricane_strike)
+		#energizing_brew,if=cooldown.fists_of_fury.remains>6&(!talent.serenity.enabled|(!buff.serenity.remains&cooldown.serenity.remains>4))&energy+energy.regen*gcd<50
+		if SpellCooldown(fists_of_fury) > 6 and { not Talent(serenity_talent) or not BuffPresent(serenity_buff) and SpellCooldown(serenity) > 4 } and Energy() + EnergyRegenRate() * GCD() < 50 Spell(energizing_brew)
+
+		unless not Talent(rushing_jade_wind_talent) and Chi() == MaxChi() and Spell(rising_sun_kick)
+		{
+			#fists_of_fury,if=talent.rushing_jade_wind.enabled&buff.tiger_power.remains>cast_time&debuff.rising_sun_kick.remains>cast_time&!buff.serenity.remains
+			if Talent(rushing_jade_wind_talent) and BuffRemaining(tiger_power_buff) > CastTime(fists_of_fury) and target.DebuffRemaining(rising_sun_kick_debuff) > CastTime(fists_of_fury) and not BuffPresent(serenity_buff) Spell(fists_of_fury)
+			#touch_of_death,if=target.health.percent<10
+			if target.HealthPercent() < 10 and BuffPresent(death_note_buff) Spell(touch_of_death)
+			#hurricane_strike,if=talent.rushing_jade_wind.enabled&talent.hurricane_strike.enabled&energy.time_to_max>cast_time&buff.tiger_power.remains>cast_time&debuff.rising_sun_kick.remains>cast_time&buff.energizing_brew.down
+			if Talent(rushing_jade_wind_talent) and Talent(hurricane_strike_talent) and TimeToMaxEnergy() > CastTime(hurricane_strike) and BuffRemaining(tiger_power_buff) > CastTime(hurricane_strike) and target.DebuffRemaining(rising_sun_kick_debuff) > CastTime(hurricane_strike) and BuffExpires(energizing_brew_buff) Spell(hurricane_strike)
+
+			unless not BuffPresent(zen_sphere_buff) and Spell(zen_sphere) or TimeToMaxEnergy() > 2 and BuffExpires(serenity_buff) and Spell(chi_wave)
+			{
+				#chi_burst,if=talent.chi_burst.enabled&energy.time_to_max>2&buff.serenity.down
+				if Talent(chi_burst_talent) and TimeToMaxEnergy() > 2 and BuffExpires(serenity_buff) and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
+			}
+		}
 	}
 }

-AddFunction WindwalkerAoeCdActions {}
+AddFunction WindwalkerAoeCdActions
+{
+	unless Chi() >= 4 and { SpellCooldown(fists_of_fury) > 3 or not Talent(rushing_jade_wind_talent) } and Spell(chi_explosion_melee) or Spell(rushing_jade_wind) or not Talent(rushing_jade_wind_talent) and Chi() == MaxChi() and Spell(rising_sun_kick) or Talent(rushing_jade_wind_talent) and BuffRemaining(tiger_power_buff) > CastTime(fists_of_fury) and target.DebuffRemaining(rising_sun_kick_debuff) > CastTime(fists_of_fury) and not BuffPresent(serenity_buff) and Spell(fists_of_fury)
+	{
+		#fortifying_brew,if=target.health.percent<10&cooldown.touch_of_death.remains=0
+		if target.HealthPercent() < 10 and not SpellCooldown(touch_of_death) > 0 Spell(fortifying_brew)
+	}
+}

-# ActionList: WindwalkerPrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction WindwalkerPrecombatActions
+AddFunction WindwalkerPrecombatMainActions
 {
 	#flask,type=greater_draenic_agility_flask
 	#food,type=rylak_crepes
-	# CHANGE: Buff with Legacy of the White Tiger
+	# CHANGE: Buff with Legacy of the White Tiger.
 	if BuffExpires(str_agi_int_buff any=1) Spell(legacy_of_the_white_tiger)
 	#stance,choose=fierce_tiger
 	Spell(stance_of_the_fierce_tiger)
-	#snapshot_stats
 }

-AddFunction WindwalkerPrecombatShortCdActions {}
-
 AddFunction WindwalkerPrecombatCdActions
 {
-	unless BuffExpires(str_agi_int_buff any=1) and Spell(legacy_of_the_white_tiger)
-		or Spell(stance_of_the_fierce_tiger)
+	# CHANGE: Buff with Legacy of the White Tiger.
+	unless BuffExpires(str_agi_int_buff any=1) and Spell(legacy_of_the_white_tiger) or Spell(stance_of_the_fierce_tiger)
 	{
+		#snapshot_stats
 		#potion,name=draenic_agility
 		UsePotionAgility()
 	}
 }

-# ActionList: WindwalkerStActions --> main, shortcd, cd
+### actions.st

-AddFunction WindwalkerStActions
+AddFunction WindwalkerStMainActions
 {
-	#energizing_brew,if=cooldown.fists_of_fury.remains>6&(!talent.serenity.enabled|(!buff.serenity.remains&cooldown.serenity.remains>4))&energy+energy.regen*gcd<50
-	if SpellCooldown(fists_of_fury) > 6 and { not Talent(serenity_talent) or not BuffPresent(serenity_buff) and SpellCooldown(serenity) > 4 } and Energy() + EnergyRegenRate() * GCD() < 50 Spell(energizing_brew)
 	#rising_sun_kick,if=!talent.chi_explosion.enabled
 	if not Talent(chi_explosion_talent) Spell(rising_sun_kick)
 	#chi_wave,if=energy.time_to_max>2&buff.serenity.down
 	if TimeToMaxEnergy() > 2 and BuffExpires(serenity_buff) Spell(chi_wave)
-	#chi_burst,if=talent.chi_burst.enabled&energy.time_to_max>2&buff.serenity.down
-	if Talent(chi_burst_talent) and TimeToMaxEnergy() > 2 and BuffExpires(serenity_buff) and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
 	#zen_sphere,cycle_targets=1,if=energy.time_to_max>2&!dot.zen_sphere.ticking&buff.serenity.down
 	if TimeToMaxEnergy() > 2 and not BuffPresent(zen_sphere_buff) and BuffExpires(serenity_buff) Spell(zen_sphere)
 	#blackout_kick,if=!talent.chi_explosion.enabled&(buff.combo_breaker_bok.react|buff.serenity.up)
 	if not Talent(chi_explosion_talent) and { BuffPresent(combo_breaker_bok_buff) or BuffPresent(serenity_buff) } Spell(blackout_kick)
-	#chi_explosion,if=talent.chi_explosion.enabled&chi>=3&buff.combo_breaker_ce.react
-	if Talent(chi_explosion_talent) and Chi() >= 3 and BuffPresent(combo_breaker_ce_buff) Spell(chi_explosion_melee)
+	#chi_explosion,if=talent.chi_explosion.enabled&chi>=3&buff.combo_breaker_ce.react&cooldown.fists_of_fury.remains>3
+	if Talent(chi_explosion_talent) and Chi() >= 3 and BuffPresent(combo_breaker_ce_buff) and SpellCooldown(fists_of_fury) > 3 Spell(chi_explosion_melee)
 	#tiger_palm,if=buff.combo_breaker_tp.react&buff.combo_breaker_tp.remains<=2
 	if BuffPresent(combo_breaker_tp_buff) and BuffRemaining(combo_breaker_tp_buff) <= 2 Spell(tiger_palm)
 	#blackout_kick,if=!talent.chi_explosion.enabled&chi.max-chi<2
@@ -438,19 +424,36 @@ AddFunction WindwalkerStActions
 	if Talent(chi_explosion_talent) and Chi() >= 3 Spell(chi_explosion_melee)
 	#jab,if=chi.max-chi>=2
 	if MaxChi() - Chi() >= 2 Spell(jab)
+	#jab,if=chi.max-chi>=1&talent.chi_explosion.enabled&cooldown.fists_of_fury.remains<=3
+	if MaxChi() - Chi() >= 1 and Talent(chi_explosion_talent) and SpellCooldown(fists_of_fury) <= 3 Spell(jab)
 }

 AddFunction WindwalkerStShortCdActions
 {
-	#fists_of_fury,if=energy.time_to_max>cast_time&buff.tiger_power.remains>cast_time&debuff.rising_sun_kick.remains>cast_time&!buff.serenity.remains
-	if TimeToMaxEnergy() > CastTime(fists_of_fury) and BuffRemaining(tiger_power_buff) > CastTime(fists_of_fury) and target.DebuffRemaining(rising_sun_kick_debuff) > CastTime(fists_of_fury) and not BuffPresent(serenity_buff) Spell(fists_of_fury)
+	#fists_of_fury,if=buff.tiger_power.remains>cast_time&debuff.rising_sun_kick.remains>cast_time&!buff.serenity.remains
+	if BuffRemaining(tiger_power_buff) > CastTime(fists_of_fury) and target.DebuffRemaining(rising_sun_kick_debuff) > CastTime(fists_of_fury) and not BuffPresent(serenity_buff) Spell(fists_of_fury)
 	#touch_of_death,if=target.health.percent<10
 	if target.HealthPercent() < 10 and BuffPresent(death_note_buff) Spell(touch_of_death)
 	#hurricane_strike,if=talent.hurricane_strike.enabled&energy.time_to_max>cast_time&buff.tiger_power.remains>cast_time&debuff.rising_sun_kick.remains>cast_time&buff.energizing_brew.down
 	if Talent(hurricane_strike_talent) and TimeToMaxEnergy() > CastTime(hurricane_strike) and BuffRemaining(tiger_power_buff) > CastTime(hurricane_strike) and target.DebuffRemaining(rising_sun_kick_debuff) > CastTime(hurricane_strike) and BuffExpires(energizing_brew_buff) Spell(hurricane_strike)
+	#energizing_brew,if=cooldown.fists_of_fury.remains>6&(!talent.serenity.enabled|(!buff.serenity.remains&cooldown.serenity.remains>4))&energy+energy.regen*gcd<50
+	if SpellCooldown(fists_of_fury) > 6 and { not Talent(serenity_talent) or not BuffPresent(serenity_buff) and SpellCooldown(serenity) > 4 } and Energy() + EnergyRegenRate() * GCD() < 50 Spell(energizing_brew)
+
+	unless not Talent(chi_explosion_talent) and Spell(rising_sun_kick) or TimeToMaxEnergy() > 2 and BuffExpires(serenity_buff) and Spell(chi_wave)
+	{
+		#chi_burst,if=talent.chi_burst.enabled&energy.time_to_max>2&buff.serenity.down
+		if Talent(chi_burst_talent) and TimeToMaxEnergy() > 2 and BuffExpires(serenity_buff) and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
+	}
 }

-AddFunction WindwalkerStCdActions {}
+AddFunction WindwalkerStCdActions
+{
+	unless BuffRemaining(tiger_power_buff) > CastTime(fists_of_fury) and target.DebuffRemaining(rising_sun_kick_debuff) > CastTime(fists_of_fury) and not BuffPresent(serenity_buff) and Spell(fists_of_fury)
+	{
+		#fortifying_brew,if=target.health.percent<10&cooldown.touch_of_death.remains=0
+		if target.HealthPercent() < 10 and not SpellCooldown(touch_of_death) > 0 Spell(fortifying_brew)
+	}
+}
 ]]
 	OvaleScripts:RegisterScript("MONK", name, desc, code, "include")
 end
@@ -469,37 +472,35 @@ AddCheckBox(opt_monk_brewmaster_aoe L(AOE) specialization=brewmaster default)

 AddIcon specialization=brewmaster help=shortcd enemies=1 checkbox=!opt_monk_brewmaster_aoe
 {
-	if InCombat(no) BrewmasterPrecombatShortCdActions()
 	BrewmasterDefaultShortCdActions()
 }

 AddIcon specialization=brewmaster help=shortcd checkbox=opt_monk_brewmaster_aoe
 {
-	if InCombat(no) BrewmasterPrecombatShortCdActions()
 	BrewmasterDefaultShortCdActions()
 }

 AddIcon specialization=brewmaster help=main enemies=1
 {
-	if InCombat(no) BrewmasterPrecombatActions()
-	BrewmasterDefaultActions()
+	if not InCombat() BrewmasterPrecombatMainActions()
+	BrewmasterDefaultMainActions()
 }

 AddIcon specialization=brewmaster help=aoe checkbox=opt_monk_brewmaster_aoe
 {
-	if InCombat(no) BrewmasterPrecombatActions()
-	BrewmasterDefaultActions()
+	if not InCombat() BrewmasterPrecombatMainActions()
+	BrewmasterDefaultMainActions()
 }

 AddIcon specialization=brewmaster help=cd enemies=1 checkbox=!opt_monk_brewmaster_aoe
 {
-	if InCombat(no) BrewmasterPrecombatCdActions()
+	if not InCombat() BrewmasterPrecombatCdActions()
 	BrewmasterDefaultCdActions()
 }

 AddIcon specialization=brewmaster help=cd checkbox=opt_monk_brewmaster_aoe
 {
-	if InCombat(no) BrewmasterPrecombatCdActions()
+	if not InCombat() BrewmasterPrecombatCdActions()
 	BrewmasterDefaultCdActions()
 }

@@ -508,37 +509,35 @@ AddCheckBox(opt_monk_windwalker_aoe L(AOE) specialization=windwalker default)

 AddIcon specialization=windwalker help=shortcd enemies=1 checkbox=!opt_monk_windwalker_aoe
 {
-	if InCombat(no) WindwalkerPrecombatShortCdActions()
 	WindwalkerDefaultShortCdActions()
 }

 AddIcon specialization=windwalker help=shortcd checkbox=opt_monk_windwalker_aoe
 {
-	if InCombat(no) WindwalkerPrecombatShortCdActions()
 	WindwalkerDefaultShortCdActions()
 }

 AddIcon specialization=windwalker help=main enemies=1
 {
-	if InCombat(no) WindwalkerPrecombatActions()
-	WindwalkerDefaultActions()
+	if not InCombat() WindwalkerPrecombatMainActions()
+	WindwalkerDefaultMainActions()
 }

 AddIcon specialization=windwalker help=aoe checkbox=opt_monk_windwalker_aoe
 {
-	if InCombat(no) WindwalkerPrecombatActions()
-	WindwalkerDefaultActions()
+	if not InCombat() WindwalkerPrecombatMainActions()
+	WindwalkerDefaultMainActions()
 }

 AddIcon specialization=windwalker help=cd enemies=1 checkbox=!opt_monk_windwalker_aoe
 {
-	if InCombat(no) WindwalkerPrecombatCdActions()
+	if not InCombat() WindwalkerPrecombatCdActions()
 	WindwalkerDefaultCdActions()
 }

 AddIcon specialization=windwalker help=cd checkbox=opt_monk_windwalker_aoe
 {
-	if InCombat(no) WindwalkerPrecombatCdActions()
+	if not InCombat() WindwalkerPrecombatCdActions()
 	WindwalkerDefaultCdActions()
 }
 ]]
diff --git a/scripts/ovale_paladin.lua b/scripts/ovale_paladin.lua
index b9a15db..209978c 100644
--- a/scripts/ovale_paladin.lua
+++ b/scripts/ovale_paladin.lua
@@ -61,7 +61,7 @@ AddFunction RighteousFuryOff
 ###
 ### Protection
 ###
-# Based on SimulationCraft profile ""Paladin_Protection_T17M".".
+# Based on SimulationCraft profile "Paladin_Protection_T17M".
 #	class=paladin
 #	spec=protection
 #	talents=3032322
@@ -78,11 +78,14 @@ AddFunction ProtectionTimeToHPG
 	if not Talent(sanctified_wrath_talent) SpellCooldown(crusader_strike judgment)
 }

-# ActionList: ProtectionDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction ProtectionDefaultActions
+AddFunction ProtectionDefaultMainActions
 {
-	#auto_attack
+	#run_action_list,name=max_dps,if=role.attack|0
+	if False(role_attack) or 0 ProtectionMaxDpsMainActions()
+	#run_action_list,name=max_survival,if=0
+	if 0 ProtectionMaxSurvivalMainActions()
 	#seal_of_insight,if=talent.empowered_seals.enabled&!seal.insight&buff.uthers_insight.remains<cooldown.judgment.remains
 	if Talent(empowered_seals_talent) and not Stance(paladin_seal_of_insight) and BuffRemaining(uthers_insight_buff) < SpellCooldown(judgment) Spell(seal_of_insight)
 	#seal_of_righteousness,if=talent.empowered_seals.enabled&!seal.righteousness&buff.uthers_insight.remains>cooldown.judgment.remains&buff.liadrins_righteousness.down
@@ -121,8 +124,6 @@ AddFunction ProtectionDefaultActions
 			Spell(avengers_shield)
 			#holy_prism,if=!talent.seraphim.enabled|buff.seraphim.up|cooldown.seraphim.remains>5|time<5
 			if not Talent(seraphim_talent) or BuffPresent(seraphim_buff) or SpellCooldown(seraphim) > 5 or TimeInCombat() < 5 Spell(holy_prism)
-			#execution_sentence,if=!talent.seraphim.enabled|buff.seraphim.up|time<12
-			if not Talent(seraphim_talent) or BuffPresent(seraphim_buff) or TimeInCombat() < 12 Spell(execution_sentence)
 			#hammer_of_wrath
 			Spell(hammer_of_wrath)
 			#sacred_shield,if=target.dot.sacred_shield.remains<8
@@ -137,6 +138,8 @@ AddFunction ProtectionDefaultActions
 			if Talent(empowered_seals_talent) and not Stance(paladin_seal_of_truth) and BuffRemaining(maraads_truth_buff) < BuffRemaining(uthers_insight_buff) and BuffRemaining(maraads_truth_buff) < BuffRemaining(liadrins_righteousness_buff) Spell(seal_of_truth)
 			#sacred_shield
 			Spell(sacred_shield)
+			#flash_of_light,if=talent.selfless_healer.enabled&buff.selfless_healer.stack>=3
+			if Talent(selfless_healer_talent) and BuffStacks(selfless_healer_buff) >= 3 Spell(flash_of_light)
 		}
 	}
 }
@@ -145,8 +148,13 @@ AddFunction ProtectionDefaultShortCdActions
 {
 	# CHANGE: Ensure that Righteous Fury is on while tanking.
 	ProtectionRighteousFury()
+	#auto_attack
 	#speed_of_light,if=movement.remains>1
 	if 0 > 1 Spell(speed_of_light)
+	#run_action_list,name=max_dps,if=role.attack|0
+	if False(role_attack) or 0 ProtectionMaxDpsShortCdActions()
+	#run_action_list,name=max_survival,if=0
+	if 0 ProtectionMaxSurvivalShortCdActions()
 	#seraphim
 	Spell(seraphim)
 	#eternal_flame,if=buff.eternal_flame.remains<2&buff.bastion_of_glory.react>2&(holy_power>=3|buff.divine_purpose.react|buff.bastion_of_power.react)
@@ -164,48 +172,33 @@ AddFunction ProtectionDefaultShortCdActions
 	#shield_of_the_righteous,if=buff.holy_avenger.remains>time_to_hpg&(!talent.seraphim.enabled|cooldown.seraphim.remains>time_to_hpg)
 	if BuffRemaining(holy_avenger_buff) > ProtectionTimeToHPG() and { not Talent(seraphim_talent) or SpellCooldown(seraphim) > ProtectionTimeToHPG() } Spell(shield_of_the_righteous)

-	unless Talent(empowered_seals_talent) and not Stance(paladin_seal_of_insight) and BuffRemaining(uthers_insight_buff) < SpellCooldown(judgment) and Spell(seal_of_insight)
-		or Talent(empowered_seals_talent) and not Stance(paladin_seal_of_righteousness) and BuffRemaining(uthers_insight_buff) > SpellCooldown(judgment) and BuffExpires(liadrins_righteousness_buff) and Spell(seal_of_righteousness)
-		or Talent(empowered_seals_talent) and not Stance(paladin_seal_of_truth) and BuffRemaining(uthers_insight_buff) > SpellCooldown(judgment) and BuffRemaining(liadrins_righteousness_buff) > SpellCooldown(judgment) and BuffExpires(maraads_truth_buff) and Spell(seal_of_truth)
-		or BuffPresent(grand_crusader_buff) and Enemies() > 1 and not Glyph(glyph_of_focused_shield) and Spell(avengers_shield)
-		or Enemies() >= 3 and Spell(hammer_of_the_righteous)
-		or Spell(crusader_strike)
+	unless Talent(empowered_seals_talent) and not Stance(paladin_seal_of_insight) and BuffRemaining(uthers_insight_buff) < SpellCooldown(judgment) and Spell(seal_of_insight) or Talent(empowered_seals_talent) and not Stance(paladin_seal_of_righteousness) and BuffRemaining(uthers_insight_buff) > SpellCooldown(judgment) and BuffExpires(liadrins_righteousness_buff) and Spell(seal_of_righteousness) or Talent(empowered_seals_talent) and not Stance(paladin_seal_of_truth) and BuffRemaining(uthers_insight_buff) > SpellCooldown(judgment) and BuffRemaining(liadrins_righteousness_buff) > SpellCooldown(judgment) and BuffExpires(maraads_truth_buff) and Spell(seal_of_truth) or BuffPresent(grand_crusader_buff) and Enemies() > 1 and not Glyph(glyph_of_focused_shield) and Spell(avengers_shield) or Enemies() >= 3 and Spell(hammer_of_the_righteous) or Spell(crusader_strike)
 	{
 		#wait,sec=cooldown.crusader_strike.remains,if=cooldown.crusader_strike.remains>0&cooldown.crusader_strike.remains<=0.35
 		unless SpellCooldown(crusader_strike) > 0 and SpellCooldown(crusader_strike) <= 0.35 and SpellCooldown(crusader_strike) > 0
 		{
-			unless Spell(judgment)
+			# CHANGE: Add a text reminder to cast Judgment on an alternate target if using Glyph of Double Jeopardy.
+			unless Glyph(glyph_of_double_jeopardy) and BuffPresent(glyph_of_double_jeopardy_buff) and Spell(judgment) or Spell(judgment)
 			{
 				#wait,sec=cooldown.judgment.remains,if=cooldown.judgment.remains>0&cooldown.judgment.remains<=0.35
 				unless SpellCooldown(judgment) > 0 and SpellCooldown(judgment) <= 0.35 and SpellCooldown(judgment) > 0
-					or Enemies() > 1 and not Glyph(glyph_of_focused_shield) and Spell(avengers_shield)
-					or Talent(sanctified_wrath_talent) and Spell(holy_wrath)
-					or BuffPresent(grand_crusader_buff) and Spell(avengers_shield)
-					or BuffPresent(sacred_shield_buff) < 2 and Spell(sacred_shield)
-					or Glyph(glyph_of_final_wrath) and target.HealthPercent() <= 20 and Spell(holy_wrath)
-					or Spell(avengers_shield)
 				{
-					#lights_hammer,if=!talent.seraphim.enabled|buff.seraphim.remains>10|cooldown.seraphim.remains<6
-					if not Talent(seraphim_talent) or BuffRemaining(seraphim_buff) > 10 or SpellCooldown(seraphim) < 6 Spell(lights_hammer)
-
-					unless { not Talent(seraphim_talent) or BuffPresent(seraphim_buff) or SpellCooldown(seraphim) > 5 or TimeInCombat() < 5 } and Spell(holy_prism)
+					unless Enemies() > 1 and not Glyph(glyph_of_focused_shield) and Spell(avengers_shield) or Talent(sanctified_wrath_talent) and Spell(holy_wrath) or BuffPresent(grand_crusader_buff) and Spell(avengers_shield) or BuffPresent(sacred_shield_buff) < 2 and Spell(sacred_shield) or Glyph(glyph_of_final_wrath) and target.HealthPercent() <= 20 and Spell(holy_wrath) or Spell(avengers_shield)
 					{
-						if target.True(debuff_flying_down) and Enemies() >= 3 Spell(consecration)
-
-						unless { not Talent(seraphim_talent) or BuffPresent(seraphim_buff) or TimeInCombat() < 12 } and Spell(execution_sentence)
-							or Spell(hammer_of_wrath)
-							or BuffPresent(sacred_shield_buff) < 8 and Spell(sacred_shield)
+						#lights_hammer,if=!talent.seraphim.enabled|buff.seraphim.remains>10|cooldown.seraphim.remains<6
+						if not Talent(seraphim_talent) or BuffRemaining(seraphim_buff) > 10 or SpellCooldown(seraphim) < 6 Spell(lights_hammer)
+
+						unless { not Talent(seraphim_talent) or BuffPresent(seraphim_buff) or SpellCooldown(seraphim) > 5 or TimeInCombat() < 5 } and Spell(holy_prism)
 						{
-							if target.True(debuff_flying_down) Spell(consecration)
-
-							unless Spell(holy_wrath)
-								or Talent(empowered_seals_talent) and not Stance(paladin_seal_of_insight) and BuffRemaining(uthers_insight_buff) <= BuffRemaining(liadrins_righteousness_buff) and BuffRemaining(uthers_insight_buff) <= BuffRemaining(maraads_truth_buff) and Spell(seal_of_insight)
-								or Talent(empowered_seals_talent) and not Stance(paladin_seal_of_righteousness) and BuffRemaining(liadrins_righteousness_buff) <= BuffRemaining(uthers_insight_buff) and BuffRemaining(liadrins_righteousness_buff) <= BuffRemaining(maraads_truth_buff) and Spell(seal_of_righteousness)
-								or Talent(empowered_seals_talent) and not Stance(paladin_seal_of_truth) and BuffRemaining(maraads_truth_buff) < BuffRemaining(uthers_insight_buff) and BuffRemaining(maraads_truth_buff) < BuffRemaining(liadrins_righteousness_buff) and Spell(seal_of_truth)
-								or Spell(sacred_shield)
+							#consecration,if=target.debuff.flying.down&active_enemies>=3
+							if target.True(debuff_flying_down) and Enemies() >= 3 Spell(consecration)
+							#execution_sentence,if=!talent.seraphim.enabled|buff.seraphim.up|time<12
+							if not Talent(seraphim_talent) or BuffPresent(seraphim_buff) or TimeInCombat() < 12 Spell(execution_sentence)
+
+							unless Spell(hammer_of_wrath) or BuffPresent(sacred_shield_buff) < 8 and Spell(sacred_shield)
 							{
-								#flash_of_light,if=talent.selfless_healer.enabled&buff.selfless_healer.stack>=3
-								if Talent(selfless_healer_talent) and BuffStacks(selfless_healer_buff) >= 3 Spell(flash_of_light)
+								#consecration,if=target.debuff.flying.down
+								if target.True(debuff_flying_down) Spell(consecration)
 							}
 						}
 					}
@@ -217,7 +210,7 @@ AddFunction ProtectionDefaultShortCdActions

 AddFunction ProtectionDefaultCdActions
 {
-	# CHANGE: Suggest interrupt actions.
+	# CHANGE: Add interrupt actions missing from SimulationCraft action list.
 	InterruptActions()
 	# CHANGE: Suggest Hand of Freedom to break root effects.
 	if IsRooted() Spell(hand_of_freedom)
@@ -227,25 +220,257 @@ AddFunction ProtectionDefaultCdActions
 	Spell(berserking)
 	#arcane_torrent
 	Spell(arcane_torrent_holy)
+	#run_action_list,name=max_dps,if=role.attack|0
+	if False(role_attack) or 0 ProtectionMaxDpsCdActions()
+	#run_action_list,name=max_survival,if=0
+	if 0 ProtectionMaxSurvivalCdActions()
 	#potion,name=draenic_armor,if=buff.shield_of_the_righteous.down&buff.seraphim.down&buff.divine_protection.down&buff.guardian_of_ancient_kings.down&buff.ardent_defender.down
 	if BuffExpires(shield_of_the_righteous_buff) and BuffExpires(seraphim_buff) and BuffExpires(divine_protection_buff) and BuffExpires(guardian_of_ancient_kings_buff) and BuffExpires(ardent_defender_buff) UsePotionArmor()
 	#holy_avenger
 	Spell(holy_avenger)
+	#divine_protection,if=time<5|!talent.seraphim.enabled|(buff.seraphim.down&cooldown.seraphim.remains>5&cooldown.seraphim.remains<9)
+	if TimeInCombat() < 5 or not Talent(seraphim_talent) or BuffExpires(seraphim_buff) and SpellCooldown(seraphim) > 5 and SpellCooldown(seraphim) < 9 Spell(divine_protection)
+	#guardian_of_ancient_kings,if=time<5|(buff.holy_avenger.down&buff.shield_of_the_righteous.down&buff.divine_protection.down)
+	if TimeInCombat() < 5 or BuffExpires(holy_avenger_buff) and BuffExpires(shield_of_the_righteous_buff) and BuffExpires(divine_protection_buff) Spell(guardian_of_ancient_kings)
+	#ardent_defender,if=time<5|(buff.holy_avenger.down&buff.shield_of_the_righteous.down&buff.divine_protection.down&buff.guardian_of_ancient_kings.down)
+	if TimeInCombat() < 5 or BuffExpires(holy_avenger_buff) and BuffExpires(shield_of_the_righteous_buff) and BuffExpires(divine_protection_buff) and BuffExpires(guardian_of_ancient_kings_buff) Spell(ardent_defender)
+}

-	unless Spell(seraphim)
+### actions.max_dps
+
+AddFunction ProtectionMaxDpsMainActions
+{
+	#avengers_shield,if=buff.grand_crusader.react&active_enemies>1&!glyph.focused_shield.enabled
+	if BuffPresent(grand_crusader_buff) and Enemies() > 1 and not Glyph(glyph_of_focused_shield) Spell(avengers_shield)
+	#holy_wrath,if=talent.sanctified_wrath.enabled&(buff.seraphim.react|(glyph.final_wrath.enabled&target.health.pct<=20))
+	if Talent(sanctified_wrath_talent) and { BuffPresent(seraphim_buff) or Glyph(glyph_of_final_wrath) and target.HealthPercent() <= 20 } Spell(holy_wrath)
+	#hammer_of_the_righteous,if=active_enemies>=3
+	if Enemies() >= 3 Spell(hammer_of_the_righteous)
+	#judgment,if=talent.empowered_seals.enabled&(buff.maraads_truth.down|buff.liadrins_righteousness.down)
+	if Talent(empowered_seals_talent) and { BuffExpires(maraads_truth_buff) or BuffExpires(liadrins_righteousness_buff) } Spell(judgment)
+	#crusader_strike
+	Spell(crusader_strike)
+	#wait,sec=cooldown.crusader_strike.remains,if=cooldown.crusader_strike.remains>0&cooldown.crusader_strike.remains<=0.35
+	unless SpellCooldown(crusader_strike) > 0 and SpellCooldown(crusader_strike) <= 0.35 and SpellCooldown(crusader_strike) > 0
 	{
-		#divine_protection,if=time<5|!talent.seraphim.enabled|(buff.seraphim.down&cooldown.seraphim.remains>5&cooldown.seraphim.remains<9)
-		if TimeInCombat() < 5 or not Talent(seraphim_talent) or BuffExpires(seraphim_buff) and SpellCooldown(seraphim) > 5 and SpellCooldown(seraphim) < 9 Spell(divine_protection)
-		#guardian_of_ancient_kings,if=time<5|(buff.holy_avenger.down&buff.shield_of_the_righteous.down&buff.divine_protection.down)
-		if TimeInCombat() < 5 or BuffExpires(holy_avenger_buff) and BuffExpires(shield_of_the_righteous_buff) and BuffExpires(divine_protection_buff) Spell(guardian_of_ancient_kings)
-		#ardent_defender,if=time<5|(buff.holy_avenger.down&buff.shield_of_the_righteous.down&buff.divine_protection.down&buff.guardian_of_ancient_kings.down)
-		if TimeInCombat() < 5 or BuffExpires(holy_avenger_buff) and BuffExpires(shield_of_the_righteous_buff) and BuffExpires(divine_protection_buff) and BuffExpires(guardian_of_ancient_kings_buff) Spell(ardent_defender)
+		# CHANGE: Add a text reminder to cast Judgment on an alternate target if using Glyph of Double Jeopardy.
+		#judgment,cycle_targets=1,if=glyph.double_jeopardy.enabled&last_judgment_target!=target
+		#if Glyph(glyph_of_double_jeopardy) and True(last_judgement_target) Spell(judgment)
+		if Glyph(glyph_of_double_jeopardy) and BuffPresent(glyph_of_double_jeopardy_buff) Spell(judgment text=double)
+		#judgment
+		Spell(judgment)
+		#wait,sec=cooldown.judgment.remains,if=cooldown.judgment.remains>0&cooldown.judgment.remains<=0.35
+		unless SpellCooldown(judgment) > 0 and SpellCooldown(judgment) <= 0.35 and SpellCooldown(judgment) > 0
+		{
+			#avengers_shield,if=active_enemies>1&!glyph.focused_shield.enabled
+			if Enemies() > 1 and not Glyph(glyph_of_focused_shield) Spell(avengers_shield)
+			#holy_wrath,if=talent.sanctified_wrath.enabled
+			if Talent(sanctified_wrath_talent) Spell(holy_wrath)
+			#avengers_shield,if=buff.grand_crusader.react
+			if BuffPresent(grand_crusader_buff) Spell(avengers_shield)
+			#holy_wrath,if=glyph.final_wrath.enabled&target.health.pct<=20
+			if Glyph(glyph_of_final_wrath) and target.HealthPercent() <= 20 Spell(holy_wrath)
+			#avengers_shield
+			Spell(avengers_shield)
+			#seal_of_truth,if=talent.empowered_seals.enabled&!seal.truth&buff.maraads_truth.remains<cooldown.judgment.remains
+			if Talent(empowered_seals_talent) and not Stance(paladin_seal_of_truth) and BuffRemaining(maraads_truth_buff) < SpellCooldown(judgment) Spell(seal_of_truth)
+			#seal_of_righteousness,if=talent.empowered_seals.enabled&!seal.righteousness&buff.maraads_truth.remains>cooldown.judgment.remains&buff.liadrins_righteousness.down
+			if Talent(empowered_seals_talent) and not Stance(paladin_seal_of_righteousness) and BuffRemaining(maraads_truth_buff) > SpellCooldown(judgment) and BuffExpires(liadrins_righteousness_buff) Spell(seal_of_righteousness)
+			#holy_prism
+			Spell(holy_prism)
+			#hammer_of_wrath
+			Spell(hammer_of_wrath)
+			#holy_wrath
+			Spell(holy_wrath)
+			#seal_of_truth,if=talent.empowered_seals.enabled&!seal.truth&buff.maraads_truth.remains<buff.liadrins_righteousness.remains
+			if Talent(empowered_seals_talent) and not Stance(paladin_seal_of_truth) and BuffRemaining(maraads_truth_buff) < BuffRemaining(liadrins_righteousness_buff) Spell(seal_of_truth)
+			#seal_of_righteousness,if=talent.empowered_seals.enabled&!seal.righteousness&buff.liadrins_righteousness.remains<buff.maraads_truth.remains
+			if Talent(empowered_seals_talent) and not Stance(paladin_seal_of_righteousness) and BuffRemaining(liadrins_righteousness_buff) < BuffRemaining(maraads_truth_buff) Spell(seal_of_righteousness)
+			#sacred_shield
+			Spell(sacred_shield)
+			#flash_of_light,if=talent.selfless_healer.enabled&buff.selfless_healer.stack>=3
+			if Talent(selfless_healer_talent) and BuffStacks(selfless_healer_buff) >= 3 Spell(flash_of_light)
+		}
 	}
 }

-# ActionList: ProtectionPrecombatActions --> main, shortcd, cd
+AddFunction ProtectionMaxDpsShortCdActions
+{
+	#seraphim
+	Spell(seraphim)
+	#shield_of_the_righteous,if=buff.divine_purpose.react
+	if BuffPresent(divine_purpose_buff) Spell(shield_of_the_righteous)
+	#shield_of_the_righteous,if=(holy_power>=5|talent.holy_avenger.enabled)&(!talent.seraphim.enabled|cooldown.seraphim.remains>5)
+	if { HolyPower() >= 5 or Talent(holy_avenger_talent) } and { not Talent(seraphim_talent) or SpellCooldown(seraphim) > 5 } Spell(shield_of_the_righteous)
+	#shield_of_the_righteous,if=buff.holy_avenger.remains>time_to_hpg&(!talent.seraphim.enabled|cooldown.seraphim.remains>time_to_hpg)
+	if BuffRemaining(holy_avenger_buff) > ProtectionTimeToHPG() and { not Talent(seraphim_talent) or SpellCooldown(seraphim) > ProtectionTimeToHPG() } Spell(shield_of_the_righteous)
+
+	unless BuffPresent(grand_crusader_buff) and Enemies() > 1 and not Glyph(glyph_of_focused_shield) and Spell(avengers_shield) or Talent(sanctified_wrath_talent) and { BuffPresent(seraphim_buff) or Glyph(glyph_of_final_wrath) and target.HealthPercent() <= 20 } and Spell(holy_wrath) or Enemies() >= 3 and Spell(hammer_of_the_righteous) or Talent(empowered_seals_talent) and { BuffExpires(maraads_truth_buff) or BuffExpires(liadrins_righteousness_buff) } and Spell(judgment) or Spell(crusader_strike)
+	{
+		#wait,sec=cooldown.crusader_strike.remains,if=cooldown.crusader_strike.remains>0&cooldown.crusader_strike.remains<=0.35
+		unless SpellCooldown(crusader_strike) > 0 and SpellCooldown(crusader_strike) <= 0.35 and SpellCooldown(crusader_strike) > 0
+		{
+			# CHANGE: Add a text reminder to cast Judgment on an alternate target if using Glyph of Double Jeopardy.
+			unless Glyph(glyph_of_double_jeopardy) and BuffPresent(glyph_of_double_jeopardy_buff) and Spell(judgment) or Spell(judgment)
+			{
+				#wait,sec=cooldown.judgment.remains,if=cooldown.judgment.remains>0&cooldown.judgment.remains<=0.35
+				unless SpellCooldown(judgment) > 0 and SpellCooldown(judgment) <= 0.35 and SpellCooldown(judgment) > 0
+				{
+					unless Enemies() > 1 and not Glyph(glyph_of_focused_shield) and Spell(avengers_shield) or Talent(sanctified_wrath_talent) and Spell(holy_wrath) or BuffPresent(grand_crusader_buff) and Spell(avengers_shield)
+					{
+						#execution_sentence,if=active_enemies<3
+						if Enemies() < 3 Spell(execution_sentence)
+
+						unless Glyph(glyph_of_final_wrath) and target.HealthPercent() <= 20 and Spell(holy_wrath) or Spell(avengers_shield) or Talent(empowered_seals_talent) and not Stance(paladin_seal_of_truth) and BuffRemaining(maraads_truth_buff) < SpellCooldown(judgment) and Spell(seal_of_truth) or Talent(empowered_seals_talent) and not Stance(paladin_seal_of_righteousness) and BuffRemaining(maraads_truth_buff) > SpellCooldown(judgment) and BuffExpires(liadrins_righteousness_buff) and Spell(seal_of_righteousness)
+						{
+							#lights_hammer
+							Spell(lights_hammer)
+
+							unless Spell(holy_prism)
+							{
+								#consecration,if=target.debuff.flying.down&active_enemies>=3
+								if target.True(debuff_flying_down) and Enemies() >= 3 Spell(consecration)
+								#execution_sentence
+								Spell(execution_sentence)
+
+								unless Spell(hammer_of_wrath)
+								{
+									#consecration,if=target.debuff.flying.down
+									if target.True(debuff_flying_down) Spell(consecration)
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+}

-AddFunction ProtectionPrecombatActions
+AddFunction ProtectionMaxDpsCdActions
+{
+	#potion,name=draenic_armor,if=buff.holy_avenger.react|buff.bloodlust.react|target.time_to_die<=60
+	if BuffPresent(holy_avenger_buff) or BuffPresent(burst_haste_buff any=1) or target.TimeToDie() <= 60 UsePotionArmor()
+	#holy_avenger
+	Spell(holy_avenger)
+}
+
+### actions.max_survival
+
+AddFunction ProtectionMaxSurvivalMainActions
+{
+	#hammer_of_the_righteous,if=active_enemies>=3
+	if Enemies() >= 3 Spell(hammer_of_the_righteous)
+	#crusader_strike
+	Spell(crusader_strike)
+	#wait,sec=cooldown.crusader_strike.remains,if=cooldown.crusader_strike.remains>0&cooldown.crusader_strike.remains<=0.35
+	unless SpellCooldown(crusader_strike) > 0 and SpellCooldown(crusader_strike) <= 0.35 and SpellCooldown(crusader_strike) > 0
+	{
+		# CHANGE: Add a text reminder to cast Judgment on an alternate target if using Glyph of Double Jeopardy.
+		#judgment,cycle_targets=1,if=glyph.double_jeopardy.enabled&last_judgment_target!=target
+		#if Glyph(glyph_of_double_jeopardy) and True(last_judgement_target) Spell(judgment)
+		if Glyph(glyph_of_double_jeopardy) and BuffPresent(glyph_of_double_jeopardy_buff) Spell(judgment text=double)
+		#judgment
+		Spell(judgment)
+		#wait,sec=cooldown.judgment.remains,if=cooldown.judgment.remains>0&cooldown.judgment.remains<=0.35
+		unless SpellCooldown(judgment) > 0 and SpellCooldown(judgment) <= 0.35 and SpellCooldown(judgment) > 0
+		{
+			#avengers_shield,if=buff.grand_crusader.react&active_enemies>1
+			if BuffPresent(grand_crusader_buff) and Enemies() > 1 Spell(avengers_shield)
+			#holy_wrath,if=talent.sanctified_wrath.enabled
+			if Talent(sanctified_wrath_talent) Spell(holy_wrath)
+			#avengers_shield,if=buff.grand_crusader.react
+			if BuffPresent(grand_crusader_buff) Spell(avengers_shield)
+			#sacred_shield,if=target.dot.sacred_shield.remains<2
+			if BuffPresent(sacred_shield_buff) < 2 Spell(sacred_shield)
+			#avengers_shield
+			Spell(avengers_shield)
+			#holy_prism
+			Spell(holy_prism)
+			#flash_of_light,if=talent.selfless_healer.enabled&buff.selfless_healer.stack>=3
+			if Talent(selfless_healer_talent) and BuffStacks(selfless_healer_buff) >= 3 Spell(flash_of_light)
+			#hammer_of_wrath
+			Spell(hammer_of_wrath)
+			#sacred_shield,if=target.dot.sacred_shield.remains<8
+			if BuffPresent(sacred_shield_buff) < 8 Spell(sacred_shield)
+			#holy_wrath,if=glyph.final_wrath.enabled&target.health.pct<=20
+			if Glyph(glyph_of_final_wrath) and target.HealthPercent() <= 20 Spell(holy_wrath)
+			#holy_wrath
+			Spell(holy_wrath)
+			#sacred_shield
+			Spell(sacred_shield)
+		}
+	}
+}
+
+AddFunction ProtectionMaxSurvivalShortCdActions
+{
+	#seraphim,if=buff.divine_protection.down&cooldown.divine_protection.remains>0
+	if BuffExpires(divine_protection_buff) and SpellCooldown(divine_protection) > 0 Spell(seraphim)
+	#eternal_flame,if=buff.eternal_flame.remains<2&buff.bastion_of_glory.react>2&(holy_power>=3|buff.divine_purpose.react|buff.bastion_of_power.react)
+	if BuffRemaining(eternal_flame_buff) < 2 and BuffStacks(bastion_of_glory_buff) > 2 and { HolyPower() >= 3 or BuffPresent(divine_purpose_buff) or BuffPresent(bastion_of_power_buff) } Spell(eternal_flame)
+	#eternal_flame,if=buff.bastion_of_power.react&buff.bastion_of_glory.react>=5
+	if BuffPresent(bastion_of_power_buff) and BuffStacks(bastion_of_glory_buff) >= 5 Spell(eternal_flame)
+	#shield_of_the_righteous,if=buff.divine_purpose.react
+	if BuffPresent(divine_purpose_buff) Spell(shield_of_the_righteous)
+	#shield_of_the_righteous,if=(holy_power>=5|incoming_damage_1500ms>=health.max*0.3)&(!talent.seraphim.enabled|cooldown.seraphim.remains>5)
+	if { HolyPower() >= 5 or IncomingDamage(1.5) >= MaxHealth() * 0.3 } and { not Talent(seraphim_talent) or SpellCooldown(seraphim) > 5 } Spell(shield_of_the_righteous)
+	#shield_of_the_righteous,if=buff.holy_avenger.remains>time_to_hpg&(!talent.seraphim.enabled|cooldown.seraphim.remains>time_to_hpg)
+	if BuffRemaining(holy_avenger_buff) > ProtectionTimeToHPG() and { not Talent(seraphim_talent) or SpellCooldown(seraphim) > ProtectionTimeToHPG() } Spell(shield_of_the_righteous)
+
+	unless Enemies() >= 3 and Spell(hammer_of_the_righteous) or Spell(crusader_strike)
+	{
+		#wait,sec=cooldown.crusader_strike.remains,if=cooldown.crusader_strike.remains>0&cooldown.crusader_strike.remains<=0.35
+		unless SpellCooldown(crusader_strike) > 0 and SpellCooldown(crusader_strike) <= 0.35 and SpellCooldown(crusader_strike) > 0
+		{
+			# CHANGE: Add a text reminder to cast Judgment on an alternate target if using Glyph of Double Jeopardy.
+			unless Glyph(glyph_of_double_jeopardy) and BuffPresent(glyph_of_double_jeopardy_buff) and Spell(judgment) or Spell(judgment)
+			{
+				#wait,sec=cooldown.judgment.remains,if=cooldown.judgment.remains>0&cooldown.judgment.remains<=0.35
+				unless SpellCooldown(judgment) > 0 and SpellCooldown(judgment) <= 0.35 and SpellCooldown(judgment) > 0
+				{
+					unless BuffPresent(grand_crusader_buff) and Enemies() > 1 and Spell(avengers_shield) or Talent(sanctified_wrath_talent) and Spell(holy_wrath) or BuffPresent(grand_crusader_buff) and Spell(avengers_shield) or BuffPresent(sacred_shield_buff) < 2 and Spell(sacred_shield) or Spell(avengers_shield)
+					{
+						#lights_hammer
+						Spell(lights_hammer)
+
+						unless Spell(holy_prism)
+						{
+							#consecration,if=target.debuff.flying.down&active_enemies>=3
+							if target.True(debuff_flying_down) and Enemies() >= 3 Spell(consecration)
+							#execution_sentence
+							Spell(execution_sentence)
+
+							unless Talent(selfless_healer_talent) and BuffStacks(selfless_healer_buff) >= 3 and Spell(flash_of_light) or Spell(hammer_of_wrath) or BuffPresent(sacred_shield_buff) < 8 and Spell(sacred_shield) or Glyph(glyph_of_final_wrath) and target.HealthPercent() <= 20 and Spell(holy_wrath)
+							{
+								#consecration,if=target.debuff.flying.down&!ticking
+								if target.True(debuff_flying_down) and not target.DebuffPresent(consecration_debuff) Spell(consecration)
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+AddFunction ProtectionMaxSurvivalCdActions
+{
+	#potion,name=draenic_armor,if=buff.shield_of_the_righteous.down&buff.seraphim.down&buff.divine_protection.down&buff.guardian_of_ancient_kings.down&buff.ardent_defender.down
+	if BuffExpires(shield_of_the_righteous_buff) and BuffExpires(seraphim_buff) and BuffExpires(divine_protection_buff) and BuffExpires(guardian_of_ancient_kings_buff) and BuffExpires(ardent_defender_buff) UsePotionArmor()
+	#holy_avenger
+	Spell(holy_avenger)
+	#divine_protection,if=time<5|!talent.seraphim.enabled|(buff.seraphim.down&cooldown.seraphim.remains>5&cooldown.seraphim.remains<9)
+	if TimeInCombat() < 5 or not Talent(seraphim_talent) or BuffExpires(seraphim_buff) and SpellCooldown(seraphim) > 5 and SpellCooldown(seraphim) < 9 Spell(divine_protection)
+	#guardian_of_ancient_kings,if=buff.holy_avenger.down&buff.shield_of_the_righteous.down&buff.divine_protection.down
+	if BuffExpires(holy_avenger_buff) and BuffExpires(shield_of_the_righteous_buff) and BuffExpires(divine_protection_buff) Spell(guardian_of_ancient_kings)
+	#ardent_defender,if=buff.holy_avenger.down&buff.shield_of_the_righteous.down&buff.divine_protection.down&buff.guardian_of_ancient_kings.down
+	if BuffExpires(holy_avenger_buff) and BuffExpires(shield_of_the_righteous_buff) and BuffExpires(divine_protection_buff) and BuffExpires(guardian_of_ancient_kings_buff) Spell(ardent_defender)
+}
+
+### actions.precombat
+
+AddFunction ProtectionPrecombatMainActions
 {
 	#flask,type=greater_draenic_stamina_flask
 	#food,type=talador_surf_and_turf
@@ -255,27 +480,15 @@ AddFunction ProtectionPrecombatActions
 	if not BuffPresent(mastery_buff any=1) Spell(blessing_of_might)
 	#seal_of_insight
 	Spell(seal_of_insight)
-	#snapshot_stats
-}
-
-AddFunction ProtectionPrecombatShortCdActions
-{
-	unless not BuffPresent(str_agi_int_buff any=1) and BuffPresent(mastery_buff any=1) and BuffExpires(mastery_buff) and Spell(blessing_of_kings)
-		or not BuffPresent(mastery_buff any=1) and Spell(blessing_of_might)
-		or Spell(seal_of_insight)
-	{
-		#sacred_shield
-		Spell(sacred_shield)
-	}
+	#sacred_shield
+	Spell(sacred_shield)
 }

 AddFunction ProtectionPrecombatCdActions
 {
-	unless not BuffPresent(str_agi_int_buff any=1) and BuffPresent(mastery_buff any=1) and BuffExpires(mastery_buff) and Spell(blessing_of_kings)
-		or not BuffPresent(mastery_buff any=1) and Spell(blessing_of_might)
-		or Spell(seal_of_insight)
-		or Spell(sacred_shield)
+	unless not BuffPresent(str_agi_int_buff any=1) and BuffPresent(mastery_buff any=1) and BuffExpires(mastery_buff) and Spell(blessing_of_kings) or not BuffPresent(mastery_buff any=1) and Spell(blessing_of_might) or Spell(seal_of_insight) or Spell(sacred_shield)
 	{
+		#snapshot_stats
 		#potion,name=draenic_armor
 		UsePotionArmor()
 	}
@@ -290,24 +503,21 @@ AddFunction ProtectionPrecombatCdActions
 #	talents=2112333
 #	glyphs=winged_vengeance/templars_verdict/righteous_retreat/fire_from_the_heavens/judgment

-# ActionList: RetributionDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction RetributionDefaultActions
+AddFunction RetributionDefaultMainActions
 {
-	#auto_attack
 	#judgment,if=talent.empowered_seals.enabled&time<2
 	if Talent(empowered_seals_talent) and TimeInCombat() < 2 Spell(judgment)
-	#seraphim
-	Spell(seraphim)
 	#wait,sec=cooldown.seraphim.remains,if=talent.seraphim.enabled&cooldown.seraphim.remains>0&cooldown.seraphim.remains<gcd.max&holy_power>=5
 	unless Talent(seraphim_talent) and SpellCooldown(seraphim) > 0 and SpellCooldown(seraphim) < GCD() and HolyPower() >= 5 and SpellCooldown(seraphim) > 0
 	{
 		#call_action_list,name=aoe,if=active_enemies>=5
-		if Enemies() >= 5 RetributionAoeActions()
+		if Enemies() >= 5 RetributionAoeMainActions()
 		#call_action_list,name=cleave,if=active_enemies>=3
-		if Enemies() >= 3 RetributionCleaveActions()
+		if Enemies() >= 3 RetributionCleaveMainActions()
 		#call_action_list,name=single
-		RetributionSingleActions()
+		RetributionSingleMainActions()
 	}
 }

@@ -315,6 +525,7 @@ AddFunction RetributionDefaultShortCdActions
 {
 	# CHANGE: Check that Righteous Fury is toggled off.
 	RighteousFuryOff()
+	#auto_attack
 	#speed_of_light,if=movement.distance>5
 	if 0 > 5 Spell(speed_of_light)

@@ -324,6 +535,8 @@ AddFunction RetributionDefaultShortCdActions
 		Spell(execution_sentence)
 		#lights_hammer
 		Spell(lights_hammer)
+		#seraphim
+		Spell(seraphim)
 	}
 }

@@ -331,12 +544,10 @@ AddFunction RetributionDefaultCdActions
 {
 	#rebuke
 	InterruptActions()
-	#potion,name=mogu_power,if=(buff.bloodlust.react|buff.avenging_wrath.up|target.time_to_die<=40)
 	#potion,name=draenic_strength,if=(buff.bloodlust.react|buff.avenging_wrath.up|target.time_to_die<=40)
+	if BuffPresent(burst_haste_buff any=1) or BuffPresent(avenging_wrath_melee_buff) or target.TimeToDie() <= 40 UsePotionStrength()

-	unless Talent(empowered_seals_talent) and TimeInCombat() < 2 and Spell(judgment)
-		or Spell(execution_sentence)
-		or Spell(lights_hammer)
+	unless Talent(empowered_seals_talent) and TimeInCombat() < 2 and Spell(judgment) or Spell(execution_sentence) or Spell(lights_hammer)
 	{
 		#use_item,name=vial_of_convulsive_shadows,if=buff.avenging_wrath.up
 		if BuffPresent(avenging_wrath_melee_buff) UseItemActions()
@@ -357,9 +568,9 @@ AddFunction RetributionDefaultCdActions
 	}
 }

-# ActionList: RetributionAoeActions --> main
+### actions.aoe

-AddFunction RetributionAoeActions
+AddFunction RetributionAoeMainActions
 {
 	#divine_storm,if=holy_power=5&(!talent.seraphim.enabled|cooldown.seraphim.remains>4)
 	if HolyPower() == 5 and { not Talent(seraphim_talent) or SpellCooldown(seraphim) > 4 } Spell(divine_storm)
@@ -385,9 +596,9 @@ AddFunction RetributionAoeActions
 	Spell(exorcism)
 }

-# ActionList: RetributionCleaveActions --> main
+### actions.cleave

-AddFunction RetributionCleaveActions
+AddFunction RetributionCleaveMainActions
 {
 	#final_verdict,if=buff.final_verdict.down&holy_power=5
 	if BuffExpires(final_verdict_buff) and HolyPower() == 5 Spell(final_verdict)
@@ -423,9 +634,9 @@ AddFunction RetributionCleaveActions
 	Spell(exorcism)
 }

-# ActionList: RetributionPrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction RetributionPrecombatActions
+AddFunction RetributionPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=sleeper_surprise
@@ -437,28 +648,21 @@ AddFunction RetributionPrecombatActions
 	if Enemies() < 2 Spell(seal_of_truth)
 	#seal_of_righteousness,if=active_enemies>=2
 	if Enemies() >= 2 Spell(seal_of_righteousness)
-	#snapshot_stats
-	#potion,name=mogu_power
-	UsePotionStrength()
 }

-AddFunction RetributionPrecombatShortCdActions {}
-
 AddFunction RetributionPrecombatCdActions
 {
-	unless not BuffPresent(str_agi_int_buff any=1) and BuffExpires(mastery_buff) and Spell(blessing_of_kings)
-		or not BuffPresent(mastery_buff any=1) and Spell(blessing_of_might)
-		or Enemies() < 2 and Spell(seal_of_truth)
-		or Enemies() >= 2 and Spell(seal_of_righteousness)
+	unless not BuffPresent(str_agi_int_buff any=1) and BuffExpires(mastery_buff) and Spell(blessing_of_kings) or not BuffPresent(mastery_buff any=1) and Spell(blessing_of_might) or Enemies() < 2 and Spell(seal_of_truth) or Enemies() >= 2 and Spell(seal_of_righteousness)
 	{
+		#snapshot_stats
 		#potion,name=draenic_strength
 		UsePotionStrength()
 	}
 }

-# ActionList: RetributionSingleActions --> main
+### actions.single

-AddFunction RetributionSingleActions
+AddFunction RetributionSingleMainActions
 {
 	#divine_storm,if=buff.divine_crusader.react&holy_power=5&buff.final_verdict.up
 	if BuffPresent(divine_crusader_buff) and HolyPower() == 5 and BuffPresent(final_verdict_buff) Spell(divine_storm)
@@ -546,81 +750,77 @@ do
 # Paladin rotation functions.
 Include(ovale_paladin)

-### Protection Icons
+### Protection icons.
 AddCheckBox(opt_paladin_protection_aoe L(AOE) specialization=protection default)

 AddIcon specialization=protection help=shortcd enemies=1 checkbox=!opt_paladin_protection_aoe
 {
-	if InCombat(no) ProtectionPrecombatShortCdActions()
 	ProtectionDefaultShortCdActions()
 }

 AddIcon specialization=protection help=shortcd checkbox=opt_paladin_protection_aoe
 {
-	if InCombat(no) ProtectionPrecombatShortCdActions()
 	ProtectionDefaultShortCdActions()
 }

 AddIcon specialization=protection help=main enemies=1
 {
-	if InCombat(no) ProtectionPrecombatActions()
-	ProtectionDefaultActions()
+	if not InCombat() ProtectionPrecombatMainActions()
+	ProtectionDefaultMainActions()
 }

 AddIcon specialization=protection help=aoe checkbox=opt_paladin_protection_aoe
 {
-	if InCombat(no) ProtectionPrecombatActions()
-	ProtectionDefaultActions()
+	if not InCombat() ProtectionPrecombatMainActions()
+	ProtectionDefaultMainActions()
 }

 AddIcon specialization=protection help=cd enemies=1 checkbox=!opt_paladin_protection_aoe
 {
-	if InCombat(no) ProtectionPrecombatCdActions()
+	if not InCombat() ProtectionPrecombatCdActions()
 	ProtectionDefaultCdActions()
 }

 AddIcon specialization=protection help=cd checkbox=opt_paladin_protection_aoe
 {
-	if InCombat(no) ProtectionPrecombatCdActions()
+	if not InCombat() ProtectionPrecombatCdActions()
 	ProtectionDefaultCdActions()
 }

-### Retribution Icons
+### Retribution icons.
 AddCheckBox(opt_paladin_retribution_aoe L(AOE) specialization=retribution default)

 AddIcon specialization=retribution help=shortcd enemies=1 checkbox=!opt_paladin_retribution_aoe
 {
-	if InCombat(no) RetributionPrecombatShortCdActions()
 	RetributionDefaultShortCdActions()
 }

 AddIcon specialization=retribution help=shortcd checkbox=opt_paladin_retribution_aoe
 {
-	if InCombat(no) RetributionPrecombatShortCdActions()
 	RetributionDefaultShortCdActions()
 }

 AddIcon specialization=retribution help=main enemies=1
 {
-	if InCombat(no) RetributionPrecombatActions()
-	RetributionDefaultActions()
+	if not InCombat() RetributionPrecombatMainActions()
+	RetributionDefaultMainActions()
 }

 AddIcon specialization=retribution help=aoe checkbox=opt_paladin_retribution_aoe
 {
-	if InCombat(no) RetributionPrecombatActions()
-	RetributionDefaultActions()
+	if not InCombat() RetributionPrecombatMainActions()
+	RetributionDefaultMainActions()
 }

 AddIcon specialization=retribution help=cd enemies=1 checkbox=!opt_paladin_retribution_aoe
 {
-	if InCombat(no) RetributionPrecombatCdActions()
+	if not InCombat() RetributionPrecombatCdActions()
 	RetributionDefaultCdActions()
 }

 AddIcon specialization=retribution help=cd checkbox=opt_paladin_retribution_aoe
 {
-	if InCombat(no) RetributionPrecombatCdActions()
+	if not InCombat() RetributionPrecombatCdActions()
 	RetributionDefaultCdActions()
 }
 ]]
diff --git a/scripts/ovale_priest.lua b/scripts/ovale_priest.lua
index 4a91b93..dc99db0 100644
--- a/scripts/ovale_priest.lua
+++ b/scripts/ovale_priest.lua
@@ -40,16 +40,16 @@ AddFunction InterruptActions
 #	talents=1133131
 #	glyphs=mind_flay/fade/sha

-# ActionList: ShadowDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction ShadowDefaultActions
+AddFunction ShadowDefaultMainActions
 {
 	#shadowform,if=!buff.shadowform.up
 	if not BuffPresent(shadowform_buff) Spell(shadowform)
 	#call_action_list,name=pvp_dispersion,if=set_bonus.pvp_2pc
-	if ArmorSetBonus(PVP 2) ShadowPvpDispersionActions()
+	if ArmorSetBonus(PVP 2) ShadowPvpDispersionMainActions()
 	#call_action_list,name=decision
-	ShadowDecisionActions()
+	ShadowDecisionMainActions()
 }

 AddFunction ShadowDefaultShortCdActions
@@ -84,9 +84,9 @@ AddFunction ShadowDefaultCdActions
 	}
 }

-# ActionList: ShadowCopActions --> main, shortcd, cd
+### actions.cop

-AddFunction ShadowCopActions
+AddFunction ShadowCopMainActions
 {
 	#devouring_plague,if=shadow_orb>=3&(cooldown.mind_blast.remains<=gcd*1.0|(cooldown.shadow_word_death.remains<=gcd*1.0&target.health.pct<20))&primary_target=0,cycle_targets=1
 	if ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) <= GCD() * 1 or SpellCooldown(shadow_word_death) <= GCD() * 1 and target.HealthPercent() < 20 } and 0 == 0 Spell(devouring_plague)
@@ -122,11 +122,7 @@ AddFunction ShadowCopActions

 AddFunction ShadowCopShortCdActions
 {
-	unless ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) <= GCD() * 1 or SpellCooldown(shadow_word_death) <= GCD() * 1 and target.HealthPercent() < 20 } and 0 == 0 and Spell(devouring_plague)
-		or ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) <= GCD() * 1 or SpellCooldown(shadow_word_death) <= GCD() * 1 and target.HealthPercent() < 20 } and Spell(devouring_plague)
-		or 0 == 0 and Spell(mind_blast)
-		or Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
-		or target.HealthPercent() < 20 and Spell(shadow_word_death)
+	unless ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) <= GCD() * 1 or SpellCooldown(shadow_word_death) <= GCD() * 1 and target.HealthPercent() < 20 } and 0 == 0 and Spell(devouring_plague) or ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) <= GCD() * 1 or SpellCooldown(shadow_word_death) <= GCD() * 1 and target.HealthPercent() < 20 } and Spell(devouring_plague) or 0 == 0 and Spell(mind_blast) or Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast) or target.HealthPercent() < 20 and Spell(shadow_word_death)
 	{
 		#halo,if=talent.halo.enabled&target.distance<=30&target.distance>=17
 		if Talent(halo_talent) and target.Distance() <= 30 and target.Distance() >= 17 Spell(halo_caster)
@@ -135,15 +131,7 @@ AddFunction ShadowCopShortCdActions
 		#divine_star,if=talent.divine_star.enabled&(active_enemies>1|target.distance<=24)
 		if Talent(divine_star_talent) and { Enemies() > 1 or target.Distance() <= 24 } Spell(divine_star_caster)

-		unless DebuffCountOnAny(shadow_word_pain_debuff) <= Enemies() and DebuffCountOnAny(shadow_word_pain_debuff) <= 5 and True(miss_react) and not target.DebuffPresent(shadow_word_pain_debuff) and Enemies() <= 5 and 0 == 0 and Spell(shadow_word_pain)
-			or DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and target.DebuffRemaining(vampiric_touch_debuff) < CastTime(vampiric_touch) and True(miss_react) and Enemies() <= 5 and 0 == 0 and Spell(vampiric_touch)
-			or Enemies() >= 5 and Spell(mind_sear)
-			or Enemies() <= 4 and BuffPresent(surge_of_darkness_buff) and Spell(mind_spike)
-			or Enemies() >= 3 and Spell(mind_sear)
-			or target.TicksRemaining(devouring_plague_debuff) > 1 and Enemies() == 1 and Spell(mind_flay)
-			or Spell(mind_spike)
-			or Speed() > 0 and Spell(shadow_word_death)
-			or BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Speed() > 0 and Spell(mind_blast)
+		unless DebuffCountOnAny(shadow_word_pain_debuff) <= Enemies() and DebuffCountOnAny(shadow_word_pain_debuff) <= 5 and True(miss_react) and not target.DebuffPresent(shadow_word_pain_debuff) and Enemies() <= 5 and 0 == 0 and Spell(shadow_word_pain) or DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and target.DebuffRemaining(vampiric_touch_debuff) < CastTime(vampiric_touch) and True(miss_react) and Enemies() <= 5 and 0 == 0 and Spell(vampiric_touch) or Enemies() >= 5 and Spell(mind_sear) or Enemies() <= 4 and BuffPresent(surge_of_darkness_buff) and Spell(mind_spike) or Enemies() >= 3 and Spell(mind_sear) or target.TicksRemaining(devouring_plague_debuff) > 1 and Enemies() == 1 and Spell(mind_flay) or Spell(mind_spike) or Speed() > 0 and Spell(shadow_word_death) or BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Speed() > 0 and Spell(mind_blast)
 		{
 			#halo,moving=1,if=talent.halo.enabled&target.distance<=30
 			if Speed() > 0 and Talent(halo_talent) and target.Distance() <= 30 Spell(halo_caster)
@@ -157,11 +145,7 @@ AddFunction ShadowCopShortCdActions

 AddFunction ShadowCopCdActions
 {
-	unless ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) <= GCD() * 1 or SpellCooldown(shadow_word_death) <= GCD() * 1 and target.HealthPercent() < 20 } and 0 == 0 and Spell(devouring_plague)
-		or ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) <= GCD() * 1 or SpellCooldown(shadow_word_death) <= GCD() * 1 and target.HealthPercent() < 20 } and Spell(devouring_plague)
-		or 0 == 0 and Spell(mind_blast)
-		or Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
-		or target.HealthPercent() < 20 and Spell(shadow_word_death)
+	unless ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) <= GCD() * 1 or SpellCooldown(shadow_word_death) <= GCD() * 1 and target.HealthPercent() < 20 } and 0 == 0 and Spell(devouring_plague) or ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) <= GCD() * 1 or SpellCooldown(shadow_word_death) <= GCD() * 1 and target.HealthPercent() < 20 } and Spell(devouring_plague) or 0 == 0 and Spell(mind_blast) or Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast) or target.HealthPercent() < 20 and Spell(shadow_word_death)
 	{
 		#mindbender,if=talent.mindbender.enabled
 		if Talent(mindbender_talent) Spell(mindbender)
@@ -170,9 +154,9 @@ AddFunction ShadowCopCdActions
 	}
 }

-# ActionList: ShadowCopDotweaveActions --> main, shortcd, cd
+### actions.cop_dotweave

-AddFunction ShadowCopDotweaveActions
+AddFunction ShadowCopDotweaveMainActions
 {
 	#devouring_plague,if=target.dot.vampiric_touch.ticking&target.dot.shadow_word_pain.ticking&shadow_orb=5&cooldown_react
 	if target.DebuffPresent(vampiric_touch_debuff) and target.DebuffPresent(shadow_word_pain_debuff) and ShadowOrbs() == 5 and not SpellCooldown(devouring_plague) > 0 Spell(devouring_plague)
@@ -216,17 +200,7 @@ AddFunction ShadowCopDotweaveActions

 AddFunction ShadowCopDotweaveShortCdActions
 {
-	unless target.DebuffPresent(vampiric_touch_debuff) and target.DebuffPresent(shadow_word_pain_debuff) and ShadowOrbs() == 5 and not SpellCooldown(devouring_plague) > 0 and Spell(devouring_plague)
-		or BuffRemaining(mental_instinct_buff) < GCD() and BuffPresent(mental_instinct_buff) and Spell(devouring_plague)
-		or target.DebuffPresent(vampiric_touch_debuff) and target.DebuffPresent(shadow_word_pain_debuff) and not BuffPresent(shadow_word_insanity_buff) and SpellCooldown(mind_blast) > 0.4 * GCD() and Spell(devouring_plague)
-		or Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() <= 2 and Spell(mind_blast)
-		or ShadowOrbs() <= 4 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
-		or ShadowOrbs() == 4 and ArmorSetBonus(T17 2) and not target.DebuffPresent(shadow_word_pain_debuff) and not target.DebuffPresent(devouring_plague_debuff) and SpellCooldown(mind_blast) < 1.2 * GCD() and SpellCooldown(mind_blast) > 0.2 * GCD() and Spell(shadow_word_pain)
-		or ShadowOrbs() == 5 and not target.DebuffPresent(devouring_plague_debuff) and not target.DebuffPresent(shadow_word_pain_debuff) and Spell(shadow_word_pain)
-		or ShadowOrbs() == 5 and not target.DebuffPresent(devouring_plague_debuff) and not target.DebuffPresent(vampiric_touch_debuff) and Spell(vampiric_touch)
-		or BuffPresent(shadow_word_insanity_buff) and BuffPresent(shadow_word_insanity_buff) and Spell(insanity)
-		or ShadowOrbs() >= 2 and target.DebuffRemaining(shadow_word_pain_debuff) >= 6 and SpellCooldown(mind_blast) > 0.5 * GCD() and target.DebuffRemaining(vampiric_touch_debuff) and BuffPresent(burst_haste_buff any=1) and not ArmorSetBonus(T17 2) and Spell(shadow_word_pain)
-		or ShadowOrbs() >= 2 and target.DebuffRemaining(vampiric_touch_debuff) >= 5 and SpellCooldown(mind_blast) > 0.5 * GCD() and BuffPresent(burst_haste_buff any=1) and not ArmorSetBonus(T17 2) and Spell(vampiric_touch)
+	unless target.DebuffPresent(vampiric_touch_debuff) and target.DebuffPresent(shadow_word_pain_debuff) and ShadowOrbs() == 5 and not SpellCooldown(devouring_plague) > 0 and Spell(devouring_plague) or BuffRemaining(mental_instinct_buff) < GCD() and BuffPresent(mental_instinct_buff) and Spell(devouring_plague) or target.DebuffPresent(vampiric_touch_debuff) and target.DebuffPresent(shadow_word_pain_debuff) and not BuffPresent(shadow_word_insanity_buff) and SpellCooldown(mind_blast) > 0.4 * GCD() and Spell(devouring_plague) or Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() <= 2 and Spell(mind_blast) or ShadowOrbs() <= 4 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast) or ShadowOrbs() == 4 and ArmorSetBonus(T17 2) and not target.DebuffPresent(shadow_word_pain_debuff) and not target.DebuffPresent(devouring_plague_debuff) and SpellCooldown(mind_blast) < 1.2 * GCD() and SpellCooldown(mind_blast) > 0.2 * GCD() and Spell(shadow_word_pain) or ShadowOrbs() == 5 and not target.DebuffPresent(devouring_plague_debuff) and not target.DebuffPresent(shadow_word_pain_debuff) and Spell(shadow_word_pain) or ShadowOrbs() == 5 and not target.DebuffPresent(devouring_plague_debuff) and not target.DebuffPresent(vampiric_touch_debuff) and Spell(vampiric_touch) or BuffPresent(shadow_word_insanity_buff) and BuffPresent(shadow_word_insanity_buff) and Spell(insanity) or ShadowOrbs() >= 2 and target.DebuffRemaining(shadow_word_pain_debuff) >= 6 and SpellCooldown(mind_blast) > 0.5 * GCD() and target.DebuffRemaining(vampiric_touch_debuff) and BuffPresent(burst_haste_buff any=1) and not ArmorSetBonus(T17 2) and Spell(shadow_word_pain) or ShadowOrbs() >= 2 and target.DebuffRemaining(vampiric_touch_debuff) >= 5 and SpellCooldown(mind_blast) > 0.5 * GCD() and BuffPresent(burst_haste_buff any=1) and not ArmorSetBonus(T17 2) and Spell(vampiric_touch)
 	{
 		#halo,if=cooldown.mind_blast.remains>0.5*gcd&talent.halo.enabled&target.distance<=30&target.distance>=17
 		if SpellCooldown(mind_blast) > 0.5 * GCD() and Talent(halo_talent) and target.Distance() <= 30 and target.Distance() >= 17 Spell(halo_caster)
@@ -235,13 +209,7 @@ AddFunction ShadowCopDotweaveShortCdActions
 		#cascade,if=cooldown.mind_blast.remains>0.5*gcd&talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
 		if SpellCooldown(mind_blast) > 0.5 * GCD() and Talent(cascade_talent) and { Enemies() > 1 or target.Distance() >= 28 } and target.Distance() <= 40 and target.Distance() >= 11 Spell(cascade_caster)

-		unless DebuffCountOnAny(shadow_word_pain_debuff) <= Enemies() and DebuffCountOnAny(shadow_word_pain_debuff) <= 5 and 0 == 0 and { not target.DebuffPresent(shadow_word_pain_debuff) or target.DebuffRemaining(shadow_word_pain_debuff) <= 18 * 0.3 } and Spell(shadow_word_pain)
-			or DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and 0 == 0 and { not target.DebuffPresent(vampiric_touch_debuff) or target.DebuffRemaining(vampiric_touch_debuff) <= 15 * 0.3 } and Spell(vampiric_touch)
-			or BuffRemaining(shadow_word_insanity_buff) <= GCD() and BuffPresent(burst_haste_buff any=1) and not target.DebuffRemaining(shadow_word_pain_debuff) and not target.DebuffRemaining(vampiric_touch_debuff) and Spell(mind_spike)
-			or { target.DebuffRemaining(shadow_word_pain_debuff) and not target.DebuffRemaining(vampiric_touch_debuff) or not target.DebuffRemaining(shadow_word_pain_debuff) and target.DebuffRemaining(vampiric_touch_debuff) } and ShadowOrbs() <= 2 and SpellCooldown(mind_blast) > 0.5 * GCD() and Spell(mind_spike)
-			or ArmorSetBonus(T17 2) and target.DebuffRemaining(shadow_word_pain_debuff) and target.DebuffRemaining(vampiric_touch_debuff) and SpellCooldown(mind_blast) > 0.9 * GCD() and Spell(mind_flay)
-			or Spell(mind_spike)
-			or Speed() > 0 and Spell(shadow_word_death)
+		unless DebuffCountOnAny(shadow_word_pain_debuff) <= Enemies() and DebuffCountOnAny(shadow_word_pain_debuff) <= 5 and 0 == 0 and { not target.DebuffPresent(shadow_word_pain_debuff) or target.DebuffRemaining(shadow_word_pain_debuff) <= 18 * 0.3 } and Spell(shadow_word_pain) or DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and 0 == 0 and { not target.DebuffPresent(vampiric_touch_debuff) or target.DebuffRemaining(vampiric_touch_debuff) <= 15 * 0.3 } and Spell(vampiric_touch) or BuffRemaining(shadow_word_insanity_buff) <= GCD() and BuffPresent(burst_haste_buff any=1) and not target.DebuffRemaining(shadow_word_pain_debuff) and not target.DebuffRemaining(vampiric_touch_debuff) and Spell(mind_spike) or { target.DebuffRemaining(shadow_word_pain_debuff) and not target.DebuffRemaining(vampiric_touch_debuff) or not target.DebuffRemaining(shadow_word_pain_debuff) and target.DebuffRemaining(vampiric_touch_debuff) } and ShadowOrbs() <= 2 and SpellCooldown(mind_blast) > 0.5 * GCD() and Spell(mind_spike) or ArmorSetBonus(T17 2) and target.DebuffRemaining(shadow_word_pain_debuff) and target.DebuffRemaining(vampiric_touch_debuff) and SpellCooldown(mind_blast) > 0.9 * GCD() and Spell(mind_flay) or Spell(mind_spike) or Speed() > 0 and Spell(shadow_word_death)
 		{
 			#halo,if=talent.halo.enabled&target.distance<=30,moving=1
 			if Talent(halo_talent) and target.Distance() <= 30 and Speed() > 0 Spell(halo_caster)
@@ -255,11 +223,7 @@ AddFunction ShadowCopDotweaveShortCdActions

 AddFunction ShadowCopDotweaveCdActions
 {
-	unless target.DebuffPresent(vampiric_touch_debuff) and target.DebuffPresent(shadow_word_pain_debuff) and ShadowOrbs() == 5 and not SpellCooldown(devouring_plague) > 0 and Spell(devouring_plague)
-		or BuffRemaining(mental_instinct_buff) < GCD() and BuffPresent(mental_instinct_buff) and Spell(devouring_plague)
-		or target.DebuffPresent(vampiric_touch_debuff) and target.DebuffPresent(shadow_word_pain_debuff) and not BuffPresent(shadow_word_insanity_buff) and SpellCooldown(mind_blast) > 0.4 * GCD() and Spell(devouring_plague)
-		or Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() <= 2 and Spell(mind_blast)
-		or ShadowOrbs() <= 4 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
+	unless target.DebuffPresent(vampiric_touch_debuff) and target.DebuffPresent(shadow_word_pain_debuff) and ShadowOrbs() == 5 and not SpellCooldown(devouring_plague) > 0 and Spell(devouring_plague) or BuffRemaining(mental_instinct_buff) < GCD() and BuffPresent(mental_instinct_buff) and Spell(devouring_plague) or target.DebuffPresent(vampiric_touch_debuff) and target.DebuffPresent(shadow_word_pain_debuff) and not BuffPresent(shadow_word_insanity_buff) and SpellCooldown(mind_blast) > 0.4 * GCD() and Spell(devouring_plague) or Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() <= 2 and Spell(mind_blast) or ShadowOrbs() <= 4 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
 	{
 		#shadowfiend,if=!talent.mindbender.enabled&!buff.shadow_word_insanity.remains
 		if not Talent(mindbender_talent) and not BuffPresent(shadow_word_insanity_buff) Spell(shadowfiend)
@@ -268,9 +232,9 @@ AddFunction ShadowCopDotweaveCdActions
 	}
 }

-# ActionList: ShadowCopMfiActions --> main, shortcd, cd
+### actions.cop_mfi

-AddFunction ShadowCopMfiActions
+AddFunction ShadowCopMfiMainActions
 {
 	#devouring_plague,if=shadow_orb=5
 	if ShadowOrbs() == 5 Spell(devouring_plague)
@@ -304,15 +268,7 @@ AddFunction ShadowCopMfiActions

 AddFunction ShadowCopMfiShortCdActions
 {
-	unless ShadowOrbs() == 5 and Spell(devouring_plague)
-		or Glyph(glyph_of_mind_harvest) and 0 == 0 and Spell(mind_blast)
-		or Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
-		or target.HealthPercent() < 20 and Spell(shadow_word_death)
-		or ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) < GCD() * 1 or target.HealthPercent() < 20 and SpellCooldown(shadow_word_death) < GCD() * 1 } and Spell(devouring_plague)
-		or DebuffCountOnAny(shadow_word_pain_debuff) <= Enemies() and DebuffCountOnAny(shadow_word_pain_debuff) <= 5 and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.3 and True(miss_react) and Enemies() <= 5 and 0 == 0 and Spell(shadow_word_pain)
-		or DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and target.DebuffRemaining(vampiric_touch_debuff) < 15 * 0.3 + CastTime(vampiric_touch) and True(miss_react) and Enemies() <= 5 and 0 == 0 and Spell(vampiric_touch)
-		or BuffRemaining(shadow_word_insanity_buff) < 0.5 * GCD() and Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) and Spell(insanity)
-		or Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) and Spell(insanity)
+	unless ShadowOrbs() == 5 and Spell(devouring_plague) or Glyph(glyph_of_mind_harvest) and 0 == 0 and Spell(mind_blast) or Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast) or target.HealthPercent() < 20 and Spell(shadow_word_death) or ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) < GCD() * 1 or target.HealthPercent() < 20 and SpellCooldown(shadow_word_death) < GCD() * 1 } and Spell(devouring_plague) or DebuffCountOnAny(shadow_word_pain_debuff) <= Enemies() and DebuffCountOnAny(shadow_word_pain_debuff) <= 5 and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.3 and True(miss_react) and Enemies() <= 5 and 0 == 0 and Spell(shadow_word_pain) or DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and target.DebuffRemaining(vampiric_touch_debuff) < 15 * 0.3 + CastTime(vampiric_touch) and True(miss_react) and Enemies() <= 5 and 0 == 0 and Spell(vampiric_touch) or BuffRemaining(shadow_word_insanity_buff) < 0.5 * GCD() and Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) and Spell(insanity) or Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) and Spell(insanity)
 	{
 		#halo,if=talent.halo.enabled&target.distance<=30&target.distance>=17
 		if Talent(halo_talent) and target.Distance() <= 30 and target.Distance() >= 17 Spell(halo_caster)
@@ -321,10 +277,7 @@ AddFunction ShadowCopMfiShortCdActions
 		#divine_star,if=talent.divine_star.enabled&(active_enemies>1|target.distance<=24)
 		if Talent(divine_star_talent) and { Enemies() > 1 or target.Distance() <= 24 } Spell(divine_star_caster)

-		unless Enemies() >= 6 and Spell(mind_sear)
-			or Spell(mind_spike)
-			or Speed() > 0 and Spell(shadow_word_death)
-			or BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Speed() > 0 and Spell(mind_blast)
+		unless Enemies() >= 6 and Spell(mind_sear) or Spell(mind_spike) or Speed() > 0 and Spell(shadow_word_death) or BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Speed() > 0 and Spell(mind_blast)
 		{
 			#halo,if=talent.halo.enabled&target.distance<=30,moving=1
 			if Talent(halo_talent) and target.Distance() <= 30 and Speed() > 0 Spell(halo_caster)
@@ -338,11 +291,7 @@ AddFunction ShadowCopMfiShortCdActions

 AddFunction ShadowCopMfiCdActions
 {
-	unless ShadowOrbs() == 5 and Spell(devouring_plague)
-		or Glyph(glyph_of_mind_harvest) and 0 == 0 and Spell(mind_blast)
-		or Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
-		or target.HealthPercent() < 20 and Spell(shadow_word_death)
-		or ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) < GCD() * 1 or target.HealthPercent() < 20 and SpellCooldown(shadow_word_death) < GCD() * 1 } and Spell(devouring_plague)
+	unless ShadowOrbs() == 5 and Spell(devouring_plague) or Glyph(glyph_of_mind_harvest) and 0 == 0 and Spell(mind_blast) or Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast) or target.HealthPercent() < 20 and Spell(shadow_word_death) or ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) < GCD() * 1 or target.HealthPercent() < 20 and SpellCooldown(shadow_word_death) < GCD() * 1 } and Spell(devouring_plague)
 	{
 		#mindbender,if=talent.mindbender.enabled
 		if Talent(mindbender_talent) Spell(mindbender)
@@ -351,20 +300,20 @@ AddFunction ShadowCopMfiCdActions
 	}
 }

-# ActionList: ShadowDecisionActions --> main, shortcd, cd
+### actions.decision

-AddFunction ShadowDecisionActions
+AddFunction ShadowDecisionMainActions
 {
 	#call_action_list,name=cop_dotweave,if=talent.clarity_of_power.enabled&talent.insanity.enabled&target.health.pct>20&active_enemies<=5
-	if Talent(clarity_of_power_talent) and Talent(insanity_talent) and target.HealthPercent() > 20 and Enemies() <= 5 ShadowCopDotweaveActions()
+	if Talent(clarity_of_power_talent) and Talent(insanity_talent) and target.HealthPercent() > 20 and Enemies() <= 5 ShadowCopDotweaveMainActions()
 	#call_action_list,name=cop_mfi,if=talent.clarity_of_power.enabled&talent.insanity.enabled&target.health.pct<=20
-	if Talent(clarity_of_power_talent) and Talent(insanity_talent) and target.HealthPercent() <= 20 ShadowCopMfiActions()
+	if Talent(clarity_of_power_talent) and Talent(insanity_talent) and target.HealthPercent() <= 20 ShadowCopMfiMainActions()
 	#call_action_list,name=cop,if=talent.clarity_of_power.enabled
-	if Talent(clarity_of_power_talent) ShadowCopActions()
+	if Talent(clarity_of_power_talent) ShadowCopMainActions()
 	#call_action_list,name=vent,if=talent.void_entropy.enabled
-	if Talent(void_entropy_talent) ShadowVentActions()
+	if Talent(void_entropy_talent) ShadowVentMainActions()
 	#call_action_list,name=main
-	ShadowMainActions()
+	ShadowMainMainActions()
 }

 AddFunction ShadowDecisionShortCdActions
@@ -395,9 +344,9 @@ AddFunction ShadowDecisionCdActions
 	ShadowMainCdActions()
 }

-# ActionList: ShadowMainActions --> main, shortcd, cd
+### actions.main

-AddFunction ShadowMainActions
+AddFunction ShadowMainMainActions
 {
 	#shadow_word_death,if=target.health.pct<20&shadow_orb<=4,cycle_targets=1
 	if target.HealthPercent() < 20 and ShadowOrbs() <= 4 Spell(shadow_word_death)
@@ -457,16 +406,7 @@ AddFunction ShadowMainActions

 AddFunction ShadowMainShortCdActions
 {
-	unless target.HealthPercent() < 20 and ShadowOrbs() <= 4 and Spell(shadow_word_death)
-		or Glyph(glyph_of_mind_harvest) and ShadowOrbs() <= 2 and Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
-		or ShadowOrbs() == 5 and Talent(surge_of_darkness_talent) and Spell(devouring_plague)
-		or ShadowOrbs() == 5 and Spell(devouring_plague)
-		or ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) < 1.5 or target.HealthPercent() < 20 and SpellCooldown(shadow_word_death) < 1.5 } and not target.DebuffPresent(devouring_plague_debuff) and Talent(surge_of_darkness_talent) and Spell(devouring_plague)
-		or ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) < 1.5 or target.HealthPercent() < 20 and SpellCooldown(shadow_word_death) < 1.5 } and Spell(devouring_plague)
-		or Glyph(glyph_of_mind_harvest) and 0 == 0 and Spell(mind_blast)
-		or Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
-		or BuffRemaining(shadow_word_insanity_buff) < 0.5 * GCD() and Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) and Spell(insanity)
-		or Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) and Spell(insanity)
+	unless target.HealthPercent() < 20 and ShadowOrbs() <= 4 and Spell(shadow_word_death) or Glyph(glyph_of_mind_harvest) and ShadowOrbs() <= 2 and Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast) or ShadowOrbs() == 5 and Talent(surge_of_darkness_talent) and Spell(devouring_plague) or ShadowOrbs() == 5 and Spell(devouring_plague) or ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) < 1.5 or target.HealthPercent() < 20 and SpellCooldown(shadow_word_death) < 1.5 } and not target.DebuffPresent(devouring_plague_debuff) and Talent(surge_of_darkness_talent) and Spell(devouring_plague) or ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) < 1.5 or target.HealthPercent() < 20 and SpellCooldown(shadow_word_death) < 1.5 } and Spell(devouring_plague) or Glyph(glyph_of_mind_harvest) and 0 == 0 and Spell(mind_blast) or Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast) or BuffRemaining(shadow_word_insanity_buff) < 0.5 * GCD() and Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) and Spell(insanity) or Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) and Spell(insanity)
 	{
 		#halo,if=talent.halo.enabled&target.distance<=30&active_enemies>2
 		if Talent(halo_talent) and target.Distance() <= 30 and Enemies() > 2 Spell(halo_caster)
@@ -475,11 +415,7 @@ AddFunction ShadowMainShortCdActions
 		#divine_star,if=talent.divine_star.enabled&active_enemies>4&target.distance<=24
 		if Talent(divine_star_talent) and Enemies() > 4 and target.Distance() <= 24 Spell(divine_star_caster)

-		unless Talent(auspicious_spirits_talent) and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.3 and True(miss_react) and Spell(shadow_word_pain)
-			or DebuffCountOnAny(shadow_word_pain_debuff) <= Enemies() and DebuffCountOnAny(shadow_word_pain_debuff) <= 5 and not Talent(auspicious_spirits_talent) and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.3 and True(miss_react) and Enemies() <= 5 and Spell(shadow_word_pain)
-			or DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and target.DebuffRemaining(vampiric_touch_debuff) < 15 * 0.3 + CastTime(vampiric_touch) and True(miss_react) and Enemies() <= 5 and Spell(vampiric_touch)
-			or not Talent(void_entropy_talent) and ShadowOrbs() >= 3 and target.TicksRemaining(devouring_plague_debuff) < 2 and Spell(devouring_plague)
-			or Enemies() <= 5 and BuffStacks(surge_of_darkness_buff) == 3 and Spell(mind_spike)
+		unless Talent(auspicious_spirits_talent) and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.3 and True(miss_react) and Spell(shadow_word_pain) or DebuffCountOnAny(shadow_word_pain_debuff) <= Enemies() and DebuffCountOnAny(shadow_word_pain_debuff) <= 5 and not Talent(auspicious_spirits_talent) and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.3 and True(miss_react) and Enemies() <= 5 and Spell(shadow_word_pain) or DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and target.DebuffRemaining(vampiric_touch_debuff) < 15 * 0.3 + CastTime(vampiric_touch) and True(miss_react) and Enemies() <= 5 and Spell(vampiric_touch) or not Talent(void_entropy_talent) and ShadowOrbs() >= 3 and target.TicksRemaining(devouring_plague_debuff) < 2 and Spell(devouring_plague) or Enemies() <= 5 and BuffStacks(surge_of_darkness_buff) == 3 and Spell(mind_spike)
 		{
 			#halo,if=talent.halo.enabled&target.distance<=30&target.distance>=17
 			if Talent(halo_talent) and target.Distance() <= 30 and target.Distance() >= 17 Spell(halo_caster)
@@ -487,7 +423,6 @@ AddFunction ShadowMainShortCdActions
 			if Talent(cascade_talent) and { Enemies() > 1 or target.Distance() >= 28 } and target.Distance() <= 40 and target.Distance() >= 11 Spell(cascade_caster)
 			#divine_star,if=talent.divine_star.enabled&(active_enemies>1|target.distance<=24)
 			if Talent(divine_star_talent) and { Enemies() > 1 or target.Distance() <= 24 } Spell(divine_star_caster)
-
 			#wait,sec=cooldown.shadow_word_death.remains,if=target.health.pct<20&cooldown.shadow_word_death.remains&cooldown.shadow_word_death.remains<0.5&active_enemies<=1
 			unless target.HealthPercent() < 20 and SpellCooldown(shadow_word_death) > 0 and SpellCooldown(shadow_word_death) < 0.5 and Enemies() <= 1 and SpellCooldown(shadow_word_death) > 0
 			{
@@ -499,11 +434,7 @@ AddFunction ShadowMainShortCdActions
 						#divine_star,if=talent.divine_star.enabled&target.distance<=28&active_enemies>1
 						if Talent(divine_star_talent) and target.Distance() <= 28 and Enemies() > 1 Spell(divine_star_caster)

-						unless Enemies() >= 4 and Spell(mind_sear)
-							or ShadowOrbs() >= 2 and target.TicksRemaining(shadow_word_pain_debuff) < 4 and Talent(insanity_talent) and Spell(shadow_word_pain)
-							or ShadowOrbs() >= 2 and target.TicksRemaining(vampiric_touch_debuff) < 4.5 and Talent(insanity_talent) and Spell(vampiric_touch)
-							or Spell(mind_flay)
-							or Speed() > 0 and BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
+						unless Enemies() >= 4 and Spell(mind_sear) or ShadowOrbs() >= 2 and target.TicksRemaining(shadow_word_pain_debuff) < 4 and Talent(insanity_talent) and Spell(shadow_word_pain) or ShadowOrbs() >= 2 and target.TicksRemaining(vampiric_touch_debuff) < 4.5 and Talent(insanity_talent) and Spell(vampiric_touch) or Spell(mind_flay) or Speed() > 0 and BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
 						{
 							#divine_star,moving=1,if=talent.divine_star.enabled&target.distance<=28
 							if Speed() > 0 and Talent(divine_star_talent) and target.Distance() <= 28 Spell(divine_star_caster)
@@ -525,9 +456,9 @@ AddFunction ShadowMainCdActions
 	if not Talent(mindbender_talent) Spell(shadowfiend)
 }

-# ActionList: ShadowPrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction ShadowPrecombatActions
+AddFunction ShadowPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	# CHANGE: Different foods for different level-100 talents: AS -> blackrock_barbecue, CoP -> sleeper_surprise, VE -> frosty_stew
@@ -536,7 +467,6 @@ AddFunction ShadowPrecombatActions
 	if not BuffPresent(stamina_buff any=1) Spell(power_word_fortitude)
 	#shadowform,if=!buff.shadowform.up
 	if not BuffPresent(shadowform_buff) Spell(shadowform)
-	#snapshot_stats
 	# CHANGE: Use Mind Spike if talented into Clarity of Power, and Vampiric Touch otherwise.
 	#mind_spike
 	#Spell(mind_spike)
@@ -544,26 +474,24 @@ AddFunction ShadowPrecombatActions
 	if not Talent(clarity_of_power_talent) Spell(vampiric_touch)
 }

-AddFunction ShadowPrecombatShortCdActions {}
-
 AddFunction ShadowPrecombatCdActions
 {
-	unless not BuffPresent(stamina_buff any=1) and Spell(power_word_fortitude)
-		or not BuffPresent(shadowform_buff) and Spell(shadowform)
+	unless not BuffPresent(stamina_buff any=1) and Spell(power_word_fortitude) or not BuffPresent(shadowform_buff) and Spell(shadowform)
 	{
+		#snapshot_stats
 		#potion,name=draenic_intellect
 		UsePotionIntellect()
 	}
 }

-# ActionList: ShadowPvpDispersionActions --> main, shortcd, cd
+### actions.pvp_dispersion

-AddFunction ShadowPvpDispersionActions
+AddFunction ShadowPvpDispersionMainActions
 {
 	#call_action_list,name=decision,if=cooldown.dispersion.remains>0
-	if SpellCooldown(dispersion) > 0 ShadowDecisionActions()
+	if SpellCooldown(dispersion) > 0 ShadowDecisionMainActions()
 	#call_action_list,name=decision
-	ShadowDecisionActions()
+	ShadowDecisionMainActions()
 }

 AddFunction ShadowPvpDispersionShortCdActions
@@ -584,9 +512,9 @@ AddFunction ShadowPvpDispersionCdActions
 	ShadowDecisionCdActions()
 }

-# ActionList: ShadowVentActions --> main, shortcd, cd
+### actions.vent

-AddFunction ShadowVentActions
+AddFunction ShadowVentMainActions
 {
 	#void_entropy,if=shadow_orb=3&!ticking&target.time_to_die>60&active_enemies=1
 	if ShadowOrbs() == 3 and not target.DebuffPresent(void_entropy_debuff) and target.TimeToDie() > 60 and Enemies() == 1 Spell(void_entropy)
@@ -638,26 +566,12 @@ AddFunction ShadowVentActions

 AddFunction ShadowVentShortCdActions
 {
-	unless ShadowOrbs() == 3 and not target.DebuffPresent(void_entropy_debuff) and target.TimeToDie() > 60 and Enemies() == 1 and Spell(void_entropy)
-		or DebuffCountOnAny(void_entropy_debuff) <= Enemies() and DebuffCountOnAny(void_entropy_debuff) <= 60 / { SpellCooldownDuration(mind_blast) * 3 * 100 / { 100 + SpellHaste() } } and not target.DebuffPresent(void_entropy_debuff) and ShadowOrbs() == 5 and Enemies() >= 1 and target.TimeToDie() > 60 and Spell(void_entropy)
-		or target.DebuffPresent(void_entropy_debuff) and target.DebuffRemaining(void_entropy_debuff) <= GCD() * 2 and not SpellCooldown(devouring_plague) > 0 and Spell(devouring_plague)
-		or ShadowOrbs() == 5 and target.DebuffRemaining(void_entropy_debuff) < 10 and Spell(devouring_plague)
-		or ShadowOrbs() == 5 and target.DebuffRemaining(void_entropy_debuff) < 20 and Spell(devouring_plague)
-		or ShadowOrbs() == 5 and target.DebuffRemaining(void_entropy_debuff) and Spell(devouring_plague)
+	unless ShadowOrbs() == 3 and not target.DebuffPresent(void_entropy_debuff) and target.TimeToDie() > 60 and Enemies() == 1 and Spell(void_entropy) or DebuffCountOnAny(void_entropy_debuff) <= Enemies() and DebuffCountOnAny(void_entropy_debuff) <= 60 / { SpellCooldownDuration(mind_blast) * 3 * 100 / { 100 + SpellHaste() } } and not target.DebuffPresent(void_entropy_debuff) and ShadowOrbs() == 5 and Enemies() >= 1 and target.TimeToDie() > 60 and Spell(void_entropy) or target.DebuffPresent(void_entropy_debuff) and target.DebuffRemaining(void_entropy_debuff) <= GCD() * 2 and not SpellCooldown(devouring_plague) > 0 and Spell(devouring_plague) or ShadowOrbs() == 5 and target.DebuffRemaining(void_entropy_debuff) < 10 and Spell(devouring_plague) or ShadowOrbs() == 5 and target.DebuffRemaining(void_entropy_debuff) < 20 and Spell(devouring_plague) or ShadowOrbs() == 5 and target.DebuffRemaining(void_entropy_debuff) and Spell(devouring_plague)
 	{
 		#halo,if=talent.halo.enabled&target.distance<=30&active_enemies>=4
 		if Talent(halo_talent) and target.Distance() <= 30 and Enemies() >= 4 Spell(halo_caster)

-		unless Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() <= 2 and Spell(mind_blast)
-			or Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() >= 3 and Spell(devouring_plague)
-			or Enemies() <= 10 and not SpellCooldown(mind_blast) > 0 and ShadowOrbs() <= 4 and Spell(mind_blast)
-			or target.HealthPercent() < 20 and not SpellCooldown(shadow_word_death) > 0 and ShadowOrbs() <= 4 and Spell(shadow_word_death)
-			or ShadowOrbs() == 4 and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.5 and ArmorSetBonus(T17 2) and SpellCooldown(mind_blast) < 1.2 * GCD() and SpellCooldown(mind_blast) > 0.2 * GCD() and Spell(shadow_word_pain)
-			or BuffRemaining(shadow_word_insanity_buff) < 0.5 * GCD() and Enemies() <= 3 and SpellCooldown(mind_blast) > 0.5 * GCD() and BuffPresent(shadow_word_insanity_buff) and Spell(insanity)
-			or Enemies() <= 3 and SpellCooldown(mind_blast) > 0.5 * GCD() and BuffPresent(shadow_word_insanity_buff) and Spell(insanity)
-			or Enemies() <= 5 and BuffStacks(surge_of_darkness_buff) == 3 and Spell(mind_spike)
-			or DebuffCountOnAny(shadow_word_pain_debuff) <= Enemies() and DebuffCountOnAny(shadow_word_pain_debuff) <= 5 and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.35 and True(miss_react) and Spell(shadow_word_pain)
-			or DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and target.DebuffRemaining(vampiric_touch_debuff) < 15 * 0.35 and True(miss_react) and Spell(vampiric_touch)
+		unless Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() <= 2 and Spell(mind_blast) or Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() >= 3 and Spell(devouring_plague) or Enemies() <= 10 and not SpellCooldown(mind_blast) > 0 and ShadowOrbs() <= 4 and Spell(mind_blast) or target.HealthPercent() < 20 and not SpellCooldown(shadow_word_death) > 0 and ShadowOrbs() <= 4 and Spell(shadow_word_death) or ShadowOrbs() == 4 and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.5 and ArmorSetBonus(T17 2) and SpellCooldown(mind_blast) < 1.2 * GCD() and SpellCooldown(mind_blast) > 0.2 * GCD() and Spell(shadow_word_pain) or BuffRemaining(shadow_word_insanity_buff) < 0.5 * GCD() and Enemies() <= 3 and SpellCooldown(mind_blast) > 0.5 * GCD() and BuffPresent(shadow_word_insanity_buff) and Spell(insanity) or Enemies() <= 3 and SpellCooldown(mind_blast) > 0.5 * GCD() and BuffPresent(shadow_word_insanity_buff) and Spell(insanity) or Enemies() <= 5 and BuffStacks(surge_of_darkness_buff) == 3 and Spell(mind_spike) or DebuffCountOnAny(shadow_word_pain_debuff) <= Enemies() and DebuffCountOnAny(shadow_word_pain_debuff) <= 5 and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.35 and True(miss_react) and Spell(shadow_word_pain) or DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and target.DebuffRemaining(vampiric_touch_debuff) < 15 * 0.35 and True(miss_react) and Spell(vampiric_touch)
 		{
 			#halo,if=talent.halo.enabled&target.distance<=30&cooldown.mind_blast.remains>0.5*gcd
 			if Talent(halo_talent) and target.Distance() <= 30 and SpellCooldown(mind_blast) > 0.5 * GCD() Spell(halo_caster)
@@ -666,11 +580,7 @@ AddFunction ShadowVentShortCdActions
 			#divine_star,if=talent.divine_star.enabled&active_enemies>4&target.distance<=24&cooldown.mind_blast.remains>0.5*gcd
 			if Talent(divine_star_talent) and Enemies() > 4 and target.Distance() <= 24 and SpellCooldown(mind_blast) > 0.5 * GCD() Spell(divine_star_caster)

-			unless Enemies() <= 5 and BuffPresent(surge_of_darkness_buff) and not SpellCooldown(mind_spike) > 0 and SpellCooldown(mind_blast) > 0.5 * GCD() and Spell(mind_spike)
-				or Enemies() >= 3 and SpellCooldown(mind_blast) > 0.5 * GCD() and Spell(mind_sear)
-				or SpellCooldown(mind_blast) > 0.5 * GCD() and Spell(mind_flay)
-				or Speed() > 0 and Spell(shadow_word_death)
-				or Speed() > 0 and BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
+			unless Enemies() <= 5 and BuffPresent(surge_of_darkness_buff) and not SpellCooldown(mind_spike) > 0 and SpellCooldown(mind_blast) > 0.5 * GCD() and Spell(mind_spike) or Enemies() >= 3 and SpellCooldown(mind_blast) > 0.5 * GCD() and Spell(mind_sear) or SpellCooldown(mind_blast) > 0.5 * GCD() and Spell(mind_flay) or Speed() > 0 and Spell(shadow_word_death) or Speed() > 0 and BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Spell(mind_blast)
 			{
 				#divine_star,moving=1,if=talent.divine_star.enabled&target.distance<=28
 				if Speed() > 0 and Talent(divine_star_talent) and target.Distance() <= 28 Spell(divine_star_caster)
@@ -701,42 +611,40 @@ do
 # Priest rotation functions.
 Include(ovale_priest)

-### Shadow icons
+### Shadow icons.
 AddCheckBox(opt_priest_shadow_aoe L(AOE) specialization=shadow default)

 AddIcon specialization=shadow help=shortcd enemies=1 checkbox=!opt_priest_shadow_aoe
 {
-	if InCombat(no) ShadowPrecombatShortCdActions()
 	ShadowDefaultShortCdActions()
 }

 AddIcon specialization=shadow help=shortcd checkbox=opt_priest_shadow_aoe
 {
-	if InCombat(no) ShadowPrecombatShortCdActions()
 	ShadowDefaultShortCdActions()
 }

 AddIcon specialization=shadow help=main enemies=1
 {
-	if InCombat(no) ShadowPrecombatActions()
-	ShadowDefaultActions()
+	if not InCombat() ShadowPrecombatMainActions()
+	ShadowDefaultMainActions()
 }

 AddIcon specialization=shadow help=aoe checkbox=opt_priest_shadow_aoe
 {
-	if InCombat(no) ShadowPrecombatActions()
-	ShadowDefaultActions()
+	if not InCombat() ShadowPrecombatMainActions()
+	ShadowDefaultMainActions()
 }

 AddIcon specialization=shadow help=cd enemies=1 checkbox=!opt_priest_shadow_aoe
 {
-	if InCombat(no) ShadowPrecombatCdActions()
+	if not InCombat() ShadowPrecombatCdActions()
 	ShadowDefaultCdActions()
 }

 AddIcon specialization=shadow help=cd checkbox=opt_priest_shadow_aoe
 {
-	if InCombat(no) ShadowPrecombatCdActions()
+	if not InCombat() ShadowPrecombatCdActions()
 	ShadowDefaultCdActions()
 }
 ]]
diff --git a/scripts/ovale_rogue.lua b/scripts/ovale_rogue.lua
index 45f5480..7ac1cbd 100644
--- a/scripts/ovale_rogue.lua
+++ b/scripts/ovale_rogue.lua
@@ -62,9 +62,9 @@ AddFunction InterruptActions
 #	talents=3000032
 #	glyphs=vendetta/energy/disappearance

-# ActionList: AssassinationDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction AssassinationDefaultActions
+AddFunction AssassinationDefaultMainActions
 {
 	#rupture,if=combo_points=5&ticks_remain<3
 	if ComboPoints() == 5 and target.TicksRemaining(rupture_debuff) < 3 Spell(rupture)
@@ -107,10 +107,7 @@ AddFunction AssassinationDefaultShortCdActions
 	#vanish,if=time>10&!buff.stealth.up
 	if TimeInCombat() > 10 and not BuffPresent(stealthed_buff any=1) Spell(vanish)

-	unless ComboPoints() == 5 and target.TicksRemaining(rupture_debuff) < 3 and Spell(rupture)
-		or Enemies() > 1 and not target.DebuffPresent(rupture_debuff) and ComboPoints() == 5 and Spell(rupture)
-		or BuffPresent(stealthed_buff any=1) and Spell(mutilate)
-		or BuffRemaining(slice_and_dice_buff) < 5 and Spell(slice_and_dice)
+	unless ComboPoints() == 5 and target.TicksRemaining(rupture_debuff) < 3 and Spell(rupture) or Enemies() > 1 and not target.DebuffPresent(rupture_debuff) and ComboPoints() == 5 and Spell(rupture) or BuffPresent(stealthed_buff any=1) and Spell(mutilate) or BuffRemaining(slice_and_dice_buff) < 5 and Spell(slice_and_dice)
 	{
 		#marked_for_death,if=combo_points=0
 		if ComboPoints() == 0 Spell(marked_for_death)
@@ -124,7 +121,7 @@ AddFunction AssassinationDefaultCdActions
 	#kick
 	InterruptActions()
 	#preparation,if=!buff.vanish.up&cooldown.vanish.remains>30
-	if not BuffPresent(vanish_buff) and SpellCooldown(vanish) > 30 Spell(preparation)
+	if not BuffPresent(vanish_buff any=1) and SpellCooldown(vanish) > 30 Spell(preparation)
 	#use_item,slot=trinket2,if=active_enemies>1|(debuff.vendetta.up&active_enemies=1)
 	if Enemies() > 1 or target.DebuffPresent(vendetta_debuff) and Enemies() == 1 UseItemActions()
 	#blood_fury
@@ -134,13 +131,7 @@ AddFunction AssassinationDefaultCdActions
 	#arcane_torrent,if=energy<60
 	if Energy() < 60 Spell(arcane_torrent_energy)

-	unless ComboPoints() == 5 and target.TicksRemaining(rupture_debuff) < 3 and Spell(rupture)
-		or Enemies() > 1 and not target.DebuffPresent(rupture_debuff) and ComboPoints() == 5 and Spell(rupture)
-		or BuffPresent(stealthed_buff any=1) Spell(mutilate)
-		or BuffRemaining(slice_and_dice_buff) < 5 and Spell(slice_and_dice)
-		or ComboPoints() > 4 and Enemies() >= 4 and target.DebuffRemaining(crimson_tempest_debuff) < 8 and Spell(crimson_tempest)
-		or ComboPoints() < 5 and Enemies() >= 4 and Spell(fan_of_knives)
-		or { target.DebuffRemaining(rupture_debuff) < 2 or ComboPoints() == 5 and target.DebuffRemaining(rupture_debuff) <= SpellData(rupture_debuff duration) * 0.3 } and Enemies() == 1 and Spell(rupture)
+	unless ComboPoints() == 5 and target.TicksRemaining(rupture_debuff) < 3 and Spell(rupture) or Enemies() > 1 and not target.DebuffPresent(rupture_debuff) and ComboPoints() == 5 and Spell(rupture) or BuffPresent(stealthed_buff any=1) and Spell(mutilate) or BuffRemaining(slice_and_dice_buff) < 5 and Spell(slice_and_dice) or ComboPoints() > 4 and Enemies() >= 4 and target.DebuffRemaining(crimson_tempest_debuff) < 8 and Spell(crimson_tempest) or ComboPoints() < 5 and Enemies() >= 4 and Spell(fan_of_knives) or { target.DebuffRemaining(rupture_debuff) < 2 or ComboPoints() == 5 and target.DebuffRemaining(rupture_debuff) <= BaseDuration(rupture_debuff) * 0.3 } and Enemies() == 1 and Spell(rupture)
 	{
 		#shadow_reflection,if=cooldown.vendetta.remains=0
 		if not SpellCooldown(vendetta) > 0 Spell(shadow_reflection)
@@ -149,17 +140,14 @@ AddFunction AssassinationDefaultCdActions
 	}
 }

-# ActionList: AssassinationPrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction AssassinationPrecombatActions
+AddFunction AssassinationPrecombatMainActions
 {
 	#flask,type=greater_draenic_agility_flask
 	#food,type=sleeper_surprise
 	#apply_poison,lethal=deadly
 	if BuffRemaining(lethal_poison_buff) < 1200 Spell(deadly_poison)
-	#snapshot_stats
-	#potion,name=virmens_bite
-	UsePotionAgility()
 	#stealth
 	if BuffExpires(stealthed_buff any=1) Spell(stealth)
 	#slice_and_dice,if=talent.marked_for_death.enabled
@@ -168,8 +156,7 @@ AddFunction AssassinationPrecombatActions

 AddFunction AssassinationPrecombatShortCdActions
 {
-	unless BuffRemaining(lethal_poison_buff) < 1200 and Spell(deadly_poison)
-		or BuffExpires(stealthed_buff any=1) and Spell(stealth)
+	unless BuffRemaining(lethal_poison_buff) < 1200 and Spell(deadly_poison) or BuffExpires(stealthed_buff any=1) and Spell(stealth)
 	{
 		#marked_for_death
 		Spell(marked_for_death)
@@ -180,6 +167,7 @@ AddFunction AssassinationPrecombatCdActions
 {
 	unless BuffRemaining(lethal_poison_buff) < 1200 and Spell(deadly_poison)
 	{
+		#snapshot_stats
 		#potion,name=draenic_agility
 		UsePotionAgility()
 	}
@@ -194,18 +182,18 @@ AddFunction AssassinationPrecombatCdActions
 #	talents=3111121
 #	glyphs=energy/disappearance

-# ActionList: CombatDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction CombatDefaultActions
+AddFunction CombatDefaultMainActions
 {
 	#ambush
 	Spell(ambush)
 	#slice_and_dice,if=buff.slice_and_dice.remains<2|((target.time_to_die>45&combo_points=5&buff.slice_and_dice.remains<12)&buff.deep_insight.down)
 	if { BuffRemaining(slice_and_dice_buff) < 2 or target.TimeToDie() > 45 and ComboPoints() == 5 and BuffRemaining(slice_and_dice_buff) < 12 and BuffExpires(deep_insight_buff) } and BuffRemaining(slice_and_dice_buff) < BaseDuration(slice_and_dice_buff) Spell(slice_and_dice)
 	#call_action_list,name=generator,if=combo_points<5|!dot.revealing_strike.ticking|(talent.anticipation.enabled&anticipation_charges<=4&buff.deep_insight.down)
-	if ComboPoints() < 5 or not target.DebuffPresent(revealing_strike_debuff) or Talent(anticipation_talent) and BuffStacks(anticipation_buff) <= 4 and BuffExpires(deep_insight_buff) CombatGeneratorActions()
+	if ComboPoints() < 5 or not target.DebuffPresent(revealing_strike_debuff) or Talent(anticipation_talent) and BuffStacks(anticipation_buff) <= 4 and BuffExpires(deep_insight_buff) CombatGeneratorMainActions()
 	#call_action_list,name=finisher,if=combo_points=5&dot.revealing_strike.ticking&(buff.deep_insight.up|!talent.anticipation.enabled|(talent.anticipation.enabled&anticipation_charges>=4))
-	if ComboPoints() == 5 and target.DebuffPresent(revealing_strike_debuff) and { BuffPresent(deep_insight_buff) or not Talent(anticipation_talent) or Talent(anticipation_talent) and BuffStacks(anticipation_buff) >= 4 } CombatFinisherActions()
+	if ComboPoints() == 5 and target.DebuffPresent(revealing_strike_debuff) and { BuffPresent(deep_insight_buff) or not Talent(anticipation_talent) or Talent(anticipation_talent) and BuffStacks(anticipation_buff) >= 4 } CombatFinisherMainActions()
 }

 AddFunction CombatDefaultShortCdActions
@@ -235,7 +223,7 @@ AddFunction CombatDefaultCdActions
 	#kick
 	InterruptActions()
 	#preparation,if=!buff.vanish.up&cooldown.vanish.remains>30
-	if not BuffPresent(vanish_buff) and SpellCooldown(vanish) > 30 Spell(preparation)
+	if not BuffPresent(vanish_buff any=1) and SpellCooldown(vanish) > 30 Spell(preparation)
 	#use_item,slot=trinket2
 	UseItemActions()
 	#blood_fury
@@ -244,12 +232,10 @@ AddFunction CombatDefaultCdActions
 	Spell(berserking)
 	#arcane_torrent,if=energy<60
 	if Energy() < 60 Spell(arcane_torrent_energy)
-
 	#shadow_reflection,if=(cooldown.killing_spree.remains<10&combo_points>3)|buff.adrenaline_rush.up
 	if SpellCooldown(killing_spree) < 10 and ComboPoints() > 3 or BuffPresent(adrenaline_rush_buff) Spell(shadow_reflection)

-	unless Spell(ambush)
-		or { BuffRemaining(slice_and_dice_buff) < 2 or target.TimeToDie() > 45 and ComboPoints() == 5 and BuffRemaining(slice_and_dice_buff) < 12 and BuffExpires(deep_insight_buff) } and BuffRemaining(slice_and_dice_buff) < BaseDuration(slice_and_dice_buff) and Spell(slice_and_dice)
+	unless Spell(ambush) or { BuffRemaining(slice_and_dice_buff) < 2 or target.TimeToDie() > 45 and ComboPoints() == 5 and BuffRemaining(slice_and_dice_buff) < 12 and BuffExpires(deep_insight_buff) } and BuffRemaining(slice_and_dice_buff) < BaseDuration(slice_and_dice_buff) and Spell(slice_and_dice)
 	{
 		#call_action_list,name=adrenaline_rush,if=(energy<35|buff.bloodlust.up)&cooldown.killing_spree.remains>10
 		if { Energy() < 35 or BuffPresent(burst_haste_buff any=1) } and SpellCooldown(killing_spree) > 10 CombatAdrenalineRushCdActions()
@@ -258,7 +244,7 @@ AddFunction CombatDefaultCdActions
 	}
 }

-# ActionList: CombatAdrenalineRushActions --> cd
+### actions.adrenaline_rush

 AddFunction CombatAdrenalineRushCdActions
 {
@@ -270,9 +256,9 @@ AddFunction CombatAdrenalineRushCdActions
 	if TimeToDie() <= BaseDuration(adrenaline_rush_buff) * 1.5 Spell(adrenaline_rush)
 }

-# ActionList: CombatFinisherActions --> main
+### actions.finisher

-AddFunction CombatFinisherActions
+AddFunction CombatFinisherMainActions
 {
 	#death_from_above
 	Spell(death_from_above)
@@ -280,9 +266,9 @@ AddFunction CombatFinisherActions
 	Spell(eviscerate)
 }

-# ActionList: CombatGeneratorActions --> main
+### actions.generator

-AddFunction CombatGeneratorActions
+AddFunction CombatGeneratorMainActions
 {
 	#revealing_strike,if=(combo_points=4&dot.revealing_strike.remains<7.2&(target.time_to_die>dot.revealing_strike.remains+7.2)|(target.time_to_die<dot.revealing_strike.remains+7.2&ticks_remain<2))|!ticking
 	if ComboPoints() == 4 and target.DebuffRemaining(revealing_strike_debuff) < 7.2 and target.TimeToDie() > target.DebuffRemaining(revealing_strike_debuff) + 7.2 or target.TimeToDie() < target.DebuffRemaining(revealing_strike_debuff) + 7.2 and target.TicksRemaining(revealing_strike_debuff) < 2 or not target.DebuffPresent(revealing_strike_debuff) Spell(revealing_strike)
@@ -290,7 +276,7 @@ AddFunction CombatGeneratorActions
 	if target.DebuffPresent(revealing_strike_debuff) Spell(sinister_strike)
 }

-# ActionList: CombatKillingSpreeActions --> cd
+### actions.killing_spree

 AddFunction CombatKillingSpreeCdActions
 {
@@ -306,15 +292,14 @@ AddFunction CombatKillingSpreeCdActions
 	if TimeToDie() <= BaseDuration(killing_spree_buff) * 1.5 Spell(killing_spree)
 }

-# ActionList: CombatPrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction CombatPrecombatActions
+AddFunction CombatPrecombatMainActions
 {
 	#flask,type=greater_draenic_agility_flask
 	#food,type=frosty_stew
 	#apply_poison,lethal=deadly
 	if BuffRemaining(lethal_poison_buff) < 1200 Spell(deadly_poison)
-	#snapshot_stats
 	#stealth
 	if BuffExpires(stealthed_buff any=1) Spell(stealth)
 	#slice_and_dice,if=talent.marked_for_death.enabled
@@ -323,8 +308,7 @@ AddFunction CombatPrecombatActions

 AddFunction CombatPrecombatShortCdActions
 {
-	unless BuffRemaining(lethal_poison_buff) < 1200 and Spell(deadly_poison)
-		or BuffExpires(stealthed_buff any=1) and Spell(stealth)
+	unless BuffRemaining(lethal_poison_buff) < 1200 and Spell(deadly_poison) or BuffExpires(stealthed_buff any=1) and Spell(stealth)
 	{
 		#marked_for_death
 		Spell(marked_for_death)
@@ -335,7 +319,8 @@ AddFunction CombatPrecombatCdActions
 {
 	unless BuffRemaining(lethal_poison_buff) < 1200 and Spell(deadly_poison)
 	{
-		#potion,name=virmens_bite
+		#snapshot_stats
+		#potion,name=draenic_agility
 		UsePotionAgility()
 	}
 }
@@ -349,9 +334,9 @@ AddFunction CombatPrecombatCdActions
 #	talents=3111122
 #	glyphs=energy/hemorrhaging_veins

-# ActionList: SubtletyDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction SubtletyDefaultActions
+AddFunction SubtletyDefaultMainActions
 {
 	# CHANGE: Ovale doesn't do integer division so change the comparator for the "combo_points" condition to ">=".
 	#slice_and_dice,if=buff.slice_and_dice.remains<10.8&buff.slice_and_dice.remains<target.time_to_die&combo_points=((target.time_to_die-buff.slice_and_dice.remains)%6)+1
@@ -364,10 +349,8 @@ AddFunction SubtletyDefaultActions
 	if not target.DebuffPresent(garrote_debuff) and TimeInCombat() < 1 Spell(garrote)
 	unless not target.DebuffPresent(garrote_debuff) and TimeInCombat() < 1 and SpellUsable(garrote) and SpellCooldown(garrote) < TimeToEnergyFor(garrote)
 	{
-		# CHANGE: Wait until 0.3s before Subterfuge expires.
-		#wait,sec=1,if=buff.subterfuge.remains>1.1&buff.subterfuge.remains<1.3&time>6
-		#unless BuffRemaining(subterfuge_buff) > 1.1 and BuffRemaining(subterfuge_buff) < 1.3 and TimeInCombat() > 6 and 1
-		unless BuffRemaining(subterfuge_buff) < 1.3 and TimeInCombat() > 6 and BuffRemaining(subterfuge_buff) > 0.3
+		#wait,sec=buff.subterfuge.remains-0.1,if=buff.subterfuge.remains>0.5&buff.subterfuge.remains<1.6&time>6
+		unless BuffRemaining(subterfuge_buff) > 0.5 and BuffRemaining(subterfuge_buff) < 1.6 and TimeInCombat() > 6 and BuffRemaining(subterfuge_buff) - 0.1 > 0
 		{
 			#pool_resource,for_next=1
 			#ambush,if=combo_points<5|(talent.anticipation.enabled&anticipation_charges<3)&(time<1.2|buff.shadow_dance.up|time>5)
@@ -376,22 +359,22 @@ AddFunction SubtletyDefaultActions
 			{
 				#pool_resource,for_next=1,extra_amount=50
 				#shadow_dance,if=energy>=50&buff.stealth.down&buff.vanish.down&debuff.find_weakness.down|(buff.bloodlust.up&(dot.hemorrhage.ticking|dot.garrote.ticking|dot.rupture.ticking))
-				unless { BuffExpires(stealthed_buff any=1) and BuffExpires(vanish_buff) and target.DebuffExpires(find_weakness_debuff) or BuffPresent(burst_haste_buff any=1) and { target.DebuffPresent(hemorrhage_debuff) or target.DebuffPresent(garrote_debuff) or target.DebuffPresent(rupture_debuff) } } and SpellUsable(shadow_dance) and SpellCooldown(shadow_dance) < TimeToEnergy(50)
+				unless { True(pool_energy 50) and BuffExpires(stealthed_buff any=1) and BuffExpires(vanish_buff any=1) and target.DebuffExpires(find_weakness_debuff) or BuffPresent(burst_haste_buff any=1) and { target.DebuffPresent(hemorrhage_debuff) or target.DebuffPresent(garrote_debuff) or target.DebuffPresent(rupture_debuff) } } and SpellUsable(shadow_dance) and SpellCooldown(shadow_dance) < TimeToEnergy(50)
 				{
 					#pool_resource,for_next=1,extra_amount=50
 					#vanish,if=talent.shadow_focus.enabled&energy>=45&energy<=75&combo_points<=3&buff.shadow_dance.down&buff.master_of_subtlety.down&debuff.find_weakness.down
-					unless Talent(shadow_focus_talent) and Energy() <= 75 and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) and SpellUsable(vanish) and SpellCooldown(vanish) < TimeToEnergy(50)
+					unless Talent(shadow_focus_talent) and True(pool_energy 50) and Energy() <= 75 and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) and SpellUsable(vanish) and SpellCooldown(vanish) < TimeToEnergy(50)
 					{
 						#pool_resource,for_next=1,extra_amount=90
 						#vanish,if=talent.subterfuge.enabled&energy>=90&combo_points<=3&buff.shadow_dance.down&buff.master_of_subtlety.down&debuff.find_weakness.down
-						unless Talent(subterfuge_talent) and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) and SpellUsable(vanish) and SpellCooldown(vanish) < TimeToEnergy(90)
+						unless Talent(subterfuge_talent) and True(pool_energy 90) and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) and SpellUsable(vanish) and SpellCooldown(vanish) < TimeToEnergy(90)
 						{
 							#run_action_list,name=generator,if=talent.anticipation.enabled&anticipation_charges<4&buff.slice_and_dice.up&dot.rupture.remains>2&(buff.slice_and_dice.remains<6|dot.rupture.remains<4)
-							if Talent(anticipation_talent) and BuffStacks(anticipation_buff) < 4 and BuffPresent(slice_and_dice_buff) and target.DebuffRemaining(rupture_debuff) > 2 and { BuffRemaining(slice_and_dice_buff) < 6 or target.DebuffRemaining(rupture_debuff) < 4 } SubtletyGeneratorActions()
+							if Talent(anticipation_talent) and BuffStacks(anticipation_buff) < 4 and BuffPresent(slice_and_dice_buff) and target.DebuffRemaining(rupture_debuff) > 2 and { BuffRemaining(slice_and_dice_buff) < 6 or target.DebuffRemaining(rupture_debuff) < 4 } SubtletyGeneratorMainActions()
 							#run_action_list,name=finisher,if=combo_points=5
-							if ComboPoints() == 5 SubtletyFinisherActions()
+							if ComboPoints() == 5 SubtletyFinisherMainActions()
 							#run_action_list,name=generator,if=combo_points<4|(combo_points=4&cooldown.honor_among_thieves.remains>1&energy>70-energy.regen)|talent.anticipation.enabled
-							if ComboPoints() < 4 or ComboPoints() == 4 and BuffRemaining(honor_among_thieves_cooldown_buff) > 1 and Energy() > 70 - EnergyRegenRate() or Talent(anticipation_talent) SubtletyGeneratorActions()
+							if ComboPoints() < 4 or ComboPoints() == 4 and BuffRemaining(honor_among_thieves_cooldown_buff) > 1 and Energy() > 70 - EnergyRegenRate() or Talent(anticipation_talent) SubtletyGeneratorMainActions()
 						}
 					}
 				}
@@ -404,17 +387,15 @@ AddFunction SubtletyDefaultShortCdActions
 {
 	# CHANGE: Get within melee range of the target.
 	GetInMeleeRange()
+	# CHANGE: Ovale doesn't do integer division so change the comparator for the "combo_points" condition to ">=".
 	unless BuffRemaining(slice_and_dice_buff) < 10.8 and BuffRemaining(slice_and_dice_buff) < target.TimeToDie() and ComboPoints() >= { target.TimeToDie() - BuffRemaining(slice_and_dice_buff) } / 6 + 1 and Spell(slice_and_dice)
-		or { ComboPoints() <= 4 and not { BuffPresent(shadow_dance_buff) and Energy() > 100 and ComboPoints() > 1 } and not BuffPresent(subterfuge_buff) or BuffPresent(subterfuge_buff) and target.DebuffPresent(find_weakness_debuff) } and Spell(premeditation)
 	{
 		#pool_resource,for_next=1
 		#garrote,if=!ticking&time<1
 		unless not target.DebuffPresent(garrote_debuff) and TimeInCombat() < 1 and SpellUsable(garrote) and SpellCooldown(garrote) < TimeToEnergyFor(garrote)
 		{
-			# CHANGE: Wait until 0.3s before Subterfuge expires.
-			#wait,sec=1,if=buff.subterfuge.remains>1.1&buff.subterfuge.remains<1.3&time>6
-			#unless BuffRemaining(subterfuge_buff) > 1.1 and BuffRemaining(subterfuge_buff) < 1.3 and TimeInCombat() > 6 and 1
-			unless BuffRemaining(subterfuge_buff) < 1.3 and TimeInCombat() > 6 and BuffRemaining(subterfuge_buff) > 0.3
+			#wait,sec=buff.subterfuge.remains-0.1,if=buff.subterfuge.remains>0.5&buff.subterfuge.remains<1.6&time>6
+			unless BuffRemaining(subterfuge_buff) > 0.5 and BuffRemaining(subterfuge_buff) < 1.6 and TimeInCombat() > 6 and BuffRemaining(subterfuge_buff) - 0.1 > 0
 			{
 				#pool_resource,for_next=1
 				#ambush,if=combo_points<5|(talent.anticipation.enabled&anticipation_charges<3)&(time<1.2|buff.shadow_dance.up|time>5)
@@ -422,19 +403,18 @@ AddFunction SubtletyDefaultShortCdActions
 				{
 					#pool_resource,for_next=1,extra_amount=50
 					#shadow_dance,if=energy>=50&buff.stealth.down&buff.vanish.down&debuff.find_weakness.down|(buff.bloodlust.up&(dot.hemorrhage.ticking|dot.garrote.ticking|dot.rupture.ticking))
-					if Energy() >= 50 and BuffExpires(stealthed_buff any=1) and BuffExpires(vanish_buff) and target.DebuffExpires(find_weakness_debuff) or BuffPresent(burst_haste_buff any=1) and { target.DebuffPresent(hemorrhage_debuff) or target.DebuffPresent(garrote_debuff) or target.DebuffPresent(rupture_debuff) } Spell(shadow_dance)
-					#Remove any 'Energy() >= 50' condition from the following statement.
-					unless { BuffExpires(stealthed_buff any=1) and BuffExpires(vanish_buff) and target.DebuffExpires(find_weakness_debuff) or BuffPresent(burst_haste_buff any=1) and { target.DebuffPresent(hemorrhage_debuff) or target.DebuffPresent(garrote_debuff) or target.DebuffPresent(rupture_debuff) } } and SpellUsable(shadow_dance) and SpellCooldown(shadow_dance) < TimeToEnergy(50)
+					if Energy() >= 50 and BuffExpires(stealthed_buff any=1) and BuffExpires(vanish_buff any=1) and target.DebuffExpires(find_weakness_debuff) or BuffPresent(burst_haste_buff any=1) and { target.DebuffPresent(hemorrhage_debuff) or target.DebuffPresent(garrote_debuff) or target.DebuffPresent(rupture_debuff) } Spell(shadow_dance)
+					unless { True(pool_energy 50) and BuffExpires(stealthed_buff any=1) and BuffExpires(vanish_buff any=1) and target.DebuffExpires(find_weakness_debuff) or BuffPresent(burst_haste_buff any=1) and { target.DebuffPresent(hemorrhage_debuff) or target.DebuffPresent(garrote_debuff) or target.DebuffPresent(rupture_debuff) } } and SpellUsable(shadow_dance) and SpellCooldown(shadow_dance) < TimeToEnergy(50)
 					{
 						#pool_resource,for_next=1,extra_amount=50
 						#vanish,if=talent.shadow_focus.enabled&energy>=45&energy<=75&combo_points<=3&buff.shadow_dance.down&buff.master_of_subtlety.down&debuff.find_weakness.down
 						if Talent(shadow_focus_talent) and Energy() >= 45 and Energy() <= 75 and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) Spell(vanish)
-						unless Talent(shadow_focus_talent) and Energy() <= 75 and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) and SpellUsable(vanish) and SpellCooldown(vanish) < TimeToEnergy(50)
+						unless Talent(shadow_focus_talent) and True(pool_energy 50) and Energy() <= 75 and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) and SpellUsable(vanish) and SpellCooldown(vanish) < TimeToEnergy(50)
 						{
 							#pool_resource,for_next=1,extra_amount=90
 							#vanish,if=talent.subterfuge.enabled&energy>=90&combo_points<=3&buff.shadow_dance.down&buff.master_of_subtlety.down&debuff.find_weakness.down
 							if Talent(subterfuge_talent) and Energy() >= 90 and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) Spell(vanish)
-							unless Talent(subterfuge_talent) and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) and SpellUsable(vanish) and SpellCooldown(vanish) < TimeToEnergy(90)
+							unless Talent(subterfuge_talent) and True(pool_energy 90) and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) and SpellUsable(vanish) and SpellCooldown(vanish) < TimeToEnergy(90)
 							{
 								#marked_for_death,if=combo_points=0
 								if ComboPoints() == 0 Spell(marked_for_death)
@@ -464,17 +444,15 @@ AddFunction SubtletyDefaultCdActions
 	#arcane_torrent,if=energy<60&buff.shadow_dance.up
 	if Energy() < 60 and BuffPresent(shadow_dance_buff) Spell(arcane_torrent_energy)

+	# CHANGE: Ovale doesn't do integer division so change the comparator for the "combo_points" condition to ">=".
 	unless BuffRemaining(slice_and_dice_buff) < 10.8 and BuffRemaining(slice_and_dice_buff) < target.TimeToDie() and ComboPoints() >= { target.TimeToDie() - BuffRemaining(slice_and_dice_buff) } / 6 + 1 and Spell(slice_and_dice)
-		or { ComboPoints() <= 4 and not { BuffPresent(shadow_dance_buff) and Energy() > 100 and ComboPoints() > 1 } and not BuffPresent(subterfuge_buff) or BuffPresent(subterfuge_buff) and target.DebuffPresent(find_weakness_debuff) } and Spell(premeditation)
 	{
 		#pool_resource,for_next=1
 		#garrote,if=!ticking&time<1
 		unless not target.DebuffPresent(garrote_debuff) and TimeInCombat() < 1 and SpellUsable(garrote) and SpellCooldown(garrote) < TimeToEnergyFor(garrote)
 		{
-			# CHANGE: Wait until 0.3s before Subterfuge expires.
-			#wait,sec=1,if=buff.subterfuge.remains>1.1&buff.subterfuge.remains<1.3&time>6
-			#unless BuffRemaining(subterfuge_buff) > 1.1 and BuffRemaining(subterfuge_buff) < 1.3 and TimeInCombat() > 6 and 1
-			unless BuffRemaining(subterfuge_buff) < 1.3 and TimeInCombat() > 6 and BuffRemaining(subterfuge_buff) > 0.3
+			#wait,sec=buff.subterfuge.remains-0.1,if=buff.subterfuge.remains>0.5&buff.subterfuge.remains<1.6&time>6
+			unless BuffRemaining(subterfuge_buff) > 0.5 and BuffRemaining(subterfuge_buff) < 1.6 and TimeInCombat() > 6 and BuffRemaining(subterfuge_buff) - 0.1 > 0
 			{
 				#pool_resource,for_next=1
 				#ambush,if=combo_points<5|(talent.anticipation.enabled&anticipation_charges<3)&(time<1.2|buff.shadow_dance.up|time>5)
@@ -482,15 +460,15 @@ AddFunction SubtletyDefaultCdActions
 				{
 					#pool_resource,for_next=1,extra_amount=50
 					#shadow_dance,if=energy>=50&buff.stealth.down&buff.vanish.down&debuff.find_weakness.down|(buff.bloodlust.up&(dot.hemorrhage.ticking|dot.garrote.ticking|dot.rupture.ticking))
-					unless { BuffExpires(stealthed_buff any=1) and BuffExpires(vanish_buff) and target.DebuffExpires(find_weakness_debuff) or BuffPresent(burst_haste_buff any=1) and { target.DebuffPresent(hemorrhage_debuff) or target.DebuffPresent(garrote_debuff) or target.DebuffPresent(rupture_debuff) } } and SpellUsable(shadow_dance) and SpellCooldown(shadow_dance) < TimeToEnergy(50)
+					unless { True(pool_energy 50) and BuffExpires(stealthed_buff any=1) and BuffExpires(vanish_buff any=1) and target.DebuffExpires(find_weakness_debuff) or BuffPresent(burst_haste_buff any=1) and { target.DebuffPresent(hemorrhage_debuff) or target.DebuffPresent(garrote_debuff) or target.DebuffPresent(rupture_debuff) } } and SpellUsable(shadow_dance) and SpellCooldown(shadow_dance) < TimeToEnergy(50)
 					{
 						#pool_resource,for_next=1,extra_amount=50
 						#vanish,if=talent.shadow_focus.enabled&energy>=45&energy<=75&combo_points<=3&buff.shadow_dance.down&buff.master_of_subtlety.down&debuff.find_weakness.down
-						unless Talent(shadow_focus_talent) and Energy() <= 75 and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) and SpellUsable(vanish) and SpellCooldown(vanish) < TimeToEnergy(50)
+						unless Talent(shadow_focus_talent) and True(pool_energy 50) and Energy() <= 75 and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) and SpellUsable(vanish) and SpellCooldown(vanish) < TimeToEnergy(50)
 						{
 							#pool_resource,for_next=1,extra_amount=90
 							#vanish,if=talent.subterfuge.enabled&energy>=90&combo_points<=3&buff.shadow_dance.down&buff.master_of_subtlety.down&debuff.find_weakness.down
-							unless Talent(subterfuge_talent) and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) and SpellUsable(vanish) and SpellCooldown(vanish) < TimeToEnergy(90)
+							unless Talent(subterfuge_talent) and True(pool_energy 90) and ComboPoints() <= 3 and BuffExpires(shadow_dance_buff) and BuffExpires(master_of_subtlety_buff) and target.DebuffExpires(find_weakness_debuff) and SpellUsable(vanish) and SpellCooldown(vanish) < TimeToEnergy(90)
 							{
 								#run_action_list,name=generator,if=talent.anticipation.enabled&anticipation_charges<4&buff.slice_and_dice.up&dot.rupture.remains>2&(buff.slice_and_dice.remains<6|dot.rupture.remains<4)
 								if Talent(anticipation_talent) and BuffStacks(anticipation_buff) < 4 and BuffPresent(slice_and_dice_buff) and target.DebuffRemaining(rupture_debuff) > 2 and { BuffRemaining(slice_and_dice_buff) < 6 or target.DebuffRemaining(rupture_debuff) < 4 } SubtletyGeneratorCdActions()
@@ -509,9 +487,9 @@ AddFunction SubtletyDefaultCdActions
 	}
 }

-# ActionList: SubtletyFinisherActions --> main, cd
+### actions.finisher

-AddFunction SubtletyFinisherActions
+AddFunction SubtletyFinisherMainActions
 {
 	#rupture,cycle_targets=1,if=(!ticking|remains<duration*0.3)&active_enemies<=3&(cooldown.death_from_above.remains>0|!talent.death_from_above.enabled)
 	if { not target.DebuffPresent(rupture_debuff) or target.DebuffRemaining(rupture_debuff) < BaseDuration(rupture_debuff) * 0.3 } and Enemies() <= 3 and { SpellCooldown(death_from_above) > 0 or not Talent(death_from_above_talent) } Spell(rupture)
@@ -527,20 +505,16 @@ AddFunction SubtletyFinisherActions

 AddFunction SubtletyFinisherCdActions
 {
-	unless { not target.DebuffPresent(rupture_debuff) or target.DebuffRemaining(rupture_debuff) < BaseDuration(rupture_debuff) * 0.3 } and Enemies() <= 3 and { SpellCooldown(death_from_above) > 0 or not Talent(death_from_above_talent) } and Spell(rupture)
-		or BuffRemaining(slice_and_dice_buff) < 10.8 and BuffRemaining(slice_and_dice_buff) < target.TimeToDie() and Spell(slice_and_dice)
-		or Spell(death_from_above)
-		or Enemies() >= 3 and target.TicksRemaining(crimson_tempest_dot_debuff) < 3 and ComboPoints() == 5 or Enemies() >= 5 and { SpellCooldown(death_from_above) > 0 or not Talent(death_from_above_talent) } and Spell(crimson_tempest)
-		or Enemies() < 4 or Enemies() > 3 and target.TicksRemaining(crimson_tempest_dot_debuff) >= 2 and { SpellCooldown(death_from_above) > 0 or not Talent(death_from_above_talent) } and Spell(eviscerate)
+	unless { not target.DebuffPresent(rupture_debuff) or target.DebuffRemaining(rupture_debuff) < BaseDuration(rupture_debuff) * 0.3 } and Enemies() <= 3 and { SpellCooldown(death_from_above) > 0 or not Talent(death_from_above_talent) } and Spell(rupture) or BuffRemaining(slice_and_dice_buff) < 10.8 and BuffRemaining(slice_and_dice_buff) < target.TimeToDie() and Spell(slice_and_dice) or Spell(death_from_above) or { Enemies() >= 3 and target.TicksRemaining(crimson_tempest_dot_debuff) < 3 and ComboPoints() == 5 or Enemies() >= 5 and { SpellCooldown(death_from_above) > 0 or not Talent(death_from_above_talent) } } and Spell(crimson_tempest) or { Enemies() < 4 or Enemies() > 3 and target.TicksRemaining(crimson_tempest_dot_debuff) >= 2 and { SpellCooldown(death_from_above) > 0 or not Talent(death_from_above_talent) } } and Spell(eviscerate)
 	{
 		#run_action_list,name=pool
 		SubtletyPoolCdActions()
 	}
 }

-# ActionList: SubtletyGeneratorActions --> main, cd
+### actions.generator

-AddFunction SubtletyGeneratorActions
+AddFunction SubtletyGeneratorMainActions
 {
 	#fan_of_knives,if=active_enemies>1
 	if Enemies() > 1 Spell(fan_of_knives)
@@ -557,33 +531,29 @@ AddFunction SubtletyGeneratorCdActions
 	#run_action_list,name=pool,if=buff.master_of_subtlety.down&buff.shadow_dance.down&debuff.find_weakness.down&(energy+cooldown.shadow_dance.remains*energy.regen<80|energy+cooldown.vanish.remains*energy.regen<60)
 	if BuffExpires(master_of_subtlety_buff) and BuffExpires(shadow_dance_buff) and target.DebuffExpires(find_weakness_debuff) and { Energy() + SpellCooldown(shadow_dance) * EnergyRegenRate() < 80 or Energy() + SpellCooldown(vanish) * EnergyRegenRate() < 60 } SubtletyPoolCdActions()

-	unless Enemies() > 1 and Spell(fan_of_knives)
-		or Energy() < 65 and EnergyRegenRate() < 16 and Spell(shuriken_toss)
-		or Spell(backstab)
-		or False(position_front) and Spell(hemorrhage)
+	unless Enemies() > 1 and Spell(fan_of_knives) or Energy() < 65 and EnergyRegenRate() < 16 and Spell(shuriken_toss) or Spell(backstab) or False(position_front) and Spell(hemorrhage)
 	{
 		#run_action_list,name=pool
 		SubtletyPoolCdActions()
 	}
 }

-# ActionList: SubtletyPoolActions --> cd
+### actions.pool

 AddFunction SubtletyPoolCdActions
 {
 	#preparation,if=!buff.vanish.up&cooldown.vanish.remains>60
-	if not BuffPresent(vanish_buff) and SpellCooldown(vanish) > 60 Spell(preparation)
+	if not BuffPresent(vanish_buff any=1) and SpellCooldown(vanish) > 60 Spell(preparation)
 }

-# ActionList: SubtletyPrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction SubtletyPrecombatActions
+AddFunction SubtletyPrecombatMainActions
 {
 	#flask,type=greater_draenic_agility_flask
 	#food,type=calamari_crepes
 	#apply_poison,lethal=deadly
 	if BuffRemaining(lethal_poison_buff) < 1200 Spell(deadly_poison)
-	#snapshot_stats
 	#stealth
 	if BuffExpires(stealthed_buff any=1) Spell(stealth)
 	# CHANGE: Cast Premeditation if not at the combo point cap.
@@ -592,15 +562,13 @@ AddFunction SubtletyPrecombatActions
 	#slice_and_dice
 	#Spell(slice_and_dice)
 	if BuffRemaining(slice_and_dice_buff) < 18 Spell(slice_and_dice)
-	#honor_among_thieves,cooldown=2.2,cooldown_stddev=0.1
 }

-AddFunction SubtletyPrecombatShortCdActions {}
-
 AddFunction SubtletyPrecombatCdActions
 {
 	unless BuffRemaining(lethal_poison_buff) < 1200 and Spell(deadly_poison)
 	{
+		#snapshot_stats
 		#potion,name=draenic_agility
 		UsePotionAgility()
 	}
@@ -623,37 +591,37 @@ AddCheckBox(opt_rogue_assassination_aoe L(AOE) specialization=assassination defa

 AddIcon specialization=assassination help=shortcd enemies=1 checkbox=!opt_rogue_assassination_aoe
 {
-	if InCombat(no) AssassinationPrecombatShortCdActions()
+	if not InCombat() AssassinationPrecombatShortCdActions()
 	AssassinationDefaultShortCdActions()
 }

 AddIcon specialization=assassination help=shortcd checkbox=opt_rogue_assassination_aoe
 {
-	if InCombat(no) AssassinationPrecombatShortCdActions()
+	if not InCombat() AssassinationPrecombatShortCdActions()
 	AssassinationDefaultShortCdActions()
 }

 AddIcon specialization=assassination help=main enemies=1
 {
-	if InCombat(no) AssassinationPrecombatActions()
-	AssassinationDefaultActions()
+	if not InCombat() AssassinationPrecombatMainActions()
+	AssassinationDefaultMainActions()
 }

 AddIcon specialization=assassination help=aoe checkbox=opt_rogue_assassination_aoe
 {
-	if InCombat(no) AssassinationPrecombatActions()
-	AssassinationDefaultActions()
+	if not InCombat() AssassinationPrecombatMainActions()
+	AssassinationDefaultMainActions()
 }

 AddIcon specialization=assassination help=cd enemies=1 checkbox=!opt_rogue_assassination_aoe
 {
-	if InCombat(no) AssassinationPrecombatCdActions()
+	if not InCombat() AssassinationPrecombatCdActions()
 	AssassinationDefaultCdActions()
 }

 AddIcon specialization=assassination help=cd checkbox=opt_rogue_assassination_aoe
 {
-	if InCombat(no) AssassinationPrecombatCdActions()
+	if not InCombat() AssassinationPrecombatCdActions()
 	AssassinationDefaultCdActions()
 }

@@ -662,37 +630,37 @@ AddCheckBox(opt_rogue_combat_aoe L(AOE) specialization=combat default)

 AddIcon specialization=combat help=shortcd enemies=1 checkbox=!opt_rogue_combat_aoe
 {
-	if InCombat(no) CombatPrecombatShortCdActions()
+	if not InCombat() CombatPrecombatShortCdActions()
 	CombatDefaultShortCdActions()
 }

 AddIcon specialization=combat help=shortcd checkbox=opt_rogue_combat_aoe
 {
-	if InCombat(no) CombatPrecombatShortCdActions()
+	if not InCombat() CombatPrecombatShortCdActions()
 	CombatDefaultShortCdActions()
 }

 AddIcon specialization=combat help=main enemies=1
 {
-	if InCombat(no) CombatPrecombatActions()
-	CombatDefaultActions()
+	if not InCombat() CombatPrecombatMainActions()
+	CombatDefaultMainActions()
 }

 AddIcon specialization=combat help=aoe checkbox=opt_rogue_combat_aoe
 {
-	if InCombat(no) CombatPrecombatActions()
-	CombatDefaultActions()
+	if not InCombat() CombatPrecombatMainActions()
+	CombatDefaultMainActions()
 }

 AddIcon specialization=combat help=cd enemies=1 checkbox=!opt_rogue_combat_aoe
 {
-	if InCombat(no) CombatPrecombatCdActions()
+	if not InCombat() CombatPrecombatCdActions()
 	CombatDefaultCdActions()
 }

 AddIcon specialization=combat help=cd checkbox=opt_rogue_combat_aoe
 {
-	if InCombat(no) CombatPrecombatCdActions()
+	if not InCombat() CombatPrecombatCdActions()
 	CombatDefaultCdActions()
 }

@@ -701,37 +669,35 @@ AddCheckBox(opt_rogue_subtlety_aoe L(AOE) specialization=subtlety default)

 AddIcon specialization=subtlety help=shortcd enemies=1 checkbox=!opt_rogue_subtlety_aoe
 {
-	if InCombat(no) SubtletyPrecombatShortCdActions()
 	SubtletyDefaultShortCdActions()
 }

 AddIcon specialization=subtlety help=shortcd checkbox=opt_rogue_subtlety_aoe
 {
-	if InCombat(no) SubtletyPrecombatShortCdActions()
 	SubtletyDefaultShortCdActions()
 }

 AddIcon specialization=subtlety help=main enemies=1
 {
-	if InCombat(no) SubtletyPrecombatActions()
-	SubtletyDefaultActions()
+	if not InCombat() SubtletyPrecombatMainActions()
+	SubtletyDefaultMainActions()
 }

 AddIcon specialization=subtlety help=aoe checkbox=opt_rogue_subtlety_aoe
 {
-	if InCombat(no) SubtletyPrecombatActions()
-	SubtletyDefaultActions()
+	if not InCombat() SubtletyPrecombatMainActions()
+	SubtletyDefaultMainActions()
 }

 AddIcon specialization=subtlety help=cd enemies=1 checkbox=!opt_rogue_subtlety_aoe
 {
-	if InCombat(no) SubtletyPrecombatCdActions()
+	if not InCombat() SubtletyPrecombatCdActions()
 	SubtletyDefaultCdActions()
 }

 AddIcon specialization=subtlety help=cd checkbox=opt_rogue_subtlety_aoe
 {
-	if InCombat(no) SubtletyPrecombatCdActions()
+	if not InCombat() SubtletyPrecombatCdActions()
 	SubtletyDefaultCdActions()
 }
 ]]
diff --git a/scripts/ovale_shaman.lua b/scripts/ovale_shaman.lua
index d584e6f..679d41d 100644
--- a/scripts/ovale_shaman.lua
+++ b/scripts/ovale_shaman.lua
@@ -63,14 +63,14 @@ AddFunction InterruptActions
 #	talents=0001011
 #	glyphs=chain_lightning

-# ActionList: ElementalDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction ElementalDefaultActions
+AddFunction ElementalDefaultMainActions
 {
 	#call_action_list,name=single,if=active_enemies=1
-	if Enemies() == 1 ElementalSingleActions()
+	if Enemies() == 1 ElementalSingleMainActions()
 	#call_action_list,name=aoe,if=active_enemies>1
-	if Enemies() > 1 ElementalAoeActions()
+	if Enemies() > 1 ElementalAoeMainActions()
 }

 AddFunction ElementalDefaultShortCdActions
@@ -107,24 +107,22 @@ AddFunction ElementalDefaultCdActions
 	if not TotemPresent(fire_elemental_totem) Spell(fire_elemental_totem)
 	#ascendance,if=active_enemies>1|(dot.flame_shock.remains>buff.ascendance.duration&(target.time_to_die<20|buff.bloodlust.up|time>=60)&cooldown.lava_burst.remains>0)
 	if { Enemies() > 1 or target.DebuffRemaining(flame_shock_debuff) > BaseDuration(ascendance_caster_buff) and { target.TimeToDie() < 20 or BuffPresent(burst_haste_buff any=1) or TimeInCombat() >= 60 } and SpellCooldown(lava_burst) > 0 } and BuffExpires(ascendance_caster_buff) Spell(ascendance_caster)
-	#call_action_list,name=single,if=active_enemies=1
-	if Enemies() == 1 ElementalSingleCdActions()
-	#call_action_list,name=aoe,if=active_enemies>1
-	if Enemies() > 1 ElementalAoeCdActions()
+
+	unless { TotemRemaining(searing_totem) >= 15 or TotemRemaining(fire_elemental_totem) >= 15 } and Spell(liquid_magma)
+	{
+		#call_action_list,name=single,if=active_enemies=1
+		if Enemies() == 1 ElementalSingleCdActions()
+	}
 }

-# ActionList: ElementalAoeActions --> main, shortcd, cd
+### actions.aoe

-AddFunction ElementalAoeActions
+AddFunction ElementalAoeMainActions
 {
-	#earthquake,cycle_targets=1,if=!ticking&(buff.enhanced_chain_lightning.up|level<=90)&active_enemies>=2
-	if not target.DebuffPresent(earthquake_debuff) and { BuffPresent(enhanced_chain_lightning_buff) or Level() <= 90 } and Enemies() >= 2 Spell(earthquake)
 	#lava_beam
 	if BuffPresent(ascendance_caster_buff) Spell(lava_beam)
 	#earth_shock,if=buff.lightning_shield.react=buff.lightning_shield.max_stack
 	if BuffStacks(lightning_shield_buff) == SpellData(lightning_shield_buff max_stacks) Spell(earth_shock)
-	#thunderstorm,if=active_enemies>=10
-	if Enemies() >= 10 Spell(thunderstorm)
 	#searing_totem,if=(!talent.liquid_magma.enabled&!totem.fire.active)|(talent.liquid_magma.enabled&pet.searing_totem.remains<=20&!pet.fire_elemental_totem.active&!buff.liquid_magma.up)
 	if not Talent(liquid_magma_talent) and not TotemPresent(fire) or Talent(liquid_magma_talent) and TotemRemaining(searing_totem) <= 20 and not TotemPresent(fire_elemental_totem) and not BuffPresent(liquid_magma_buff) Spell(searing_totem)
 	#chain_lightning,if=active_enemies>=2
@@ -133,35 +131,41 @@ AddFunction ElementalAoeActions
 	Spell(lightning_bolt)
 }

-AddFunction ElementalAoeShortCdActions {}
+AddFunction ElementalAoeShortCdActions
+{
+	#earthquake,cycle_targets=1,if=!ticking&(buff.enhanced_chain_lightning.up|level<=90)&active_enemies>=2
+	if not target.DebuffPresent(earthquake_debuff) and { BuffPresent(enhanced_chain_lightning_buff) or Level() <= 90 } and Enemies() >= 2 Spell(earthquake)

-AddFunction ElementalAoeCdActions {}
+	unless BuffPresent(ascendance_caster_buff) and Spell(lava_beam) or BuffStacks(lightning_shield_buff) == SpellData(lightning_shield_buff max_stacks) and Spell(earth_shock)
+	{
+		#thunderstorm,if=active_enemies>=10
+		if Enemies() >= 10 Spell(thunderstorm)
+	}
+}

-# ActionList: ElementalPrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction ElementalPrecombatActions
+AddFunction ElementalPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=calamari_crepes
 	#lightning_shield,if=!buff.lightning_shield.up
 	if not BuffPresent(lightning_shield_buff) Spell(lightning_shield)
-	#snapshot_stats
 }

-AddFunction ElementalPrecombatShortCdActions {}
-
 AddFunction ElementalPrecombatCdActions
 {
 	unless not BuffPresent(lightning_shield_buff) and Spell(lightning_shield)
 	{
+		#snapshot_stats
 		#potion,name=draenic_intellect
 		UsePotionIntellect()
 	}
 }

-# ActionList: ElementalSingleActions --> main, shortcd, cd
+### actions.single

-AddFunction ElementalSingleActions
+AddFunction ElementalSingleMainActions
 {
 	#unleash_flame,moving=1
 	if Speed() > 0 Spell(unleash_flame)
@@ -187,43 +191,38 @@ AddFunction ElementalSingleActions

 AddFunction ElementalSingleShortCdActions
 {
+	unless Speed() > 0 and Spell(unleash_flame) or BuffStacks(lightning_shield_buff) == SpellData(lightning_shield_buff max_stacks) and Spell(earth_shock) or target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and { BuffPresent(ascendance_caster_buff) or not SpellCooldown(lava_burst) > 0 } and Spell(lava_burst) or Talent(unleashed_fury_talent) and not BuffPresent(ascendance_caster_buff) and Spell(unleash_flame) or target.DebuffRemaining(flame_shock_debuff) <= 9 and Spell(flame_shock) or { ArmorSetBonus(T17 4) and BuffStacks(lightning_shield_buff) >= 15 and not BuffPresent(lava_surge_buff) or not ArmorSetBonus(T17 4) and BuffStacks(lightning_shield_buff) > 15 } and Spell(earth_shock)
+	{
+		#earthquake,if=!talent.unleashed_fury.enabled&((1+stat.spell_haste)*(1+(mastery_value*2%4.5))>=(1.875+(1.25*0.226305)+1.25*(2*0.226305*stat.multistrike_pct%100)))&target.time_to_die>10&buff.elemental_mastery.down&buff.bloodlust.down
+		if not Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 and target.TimeToDie() > 10 and BuffExpires(elemental_mastery_buff) and BuffExpires(burst_haste_buff any=1) Spell(earthquake)
+		#earthquake,if=!talent.unleashed_fury.enabled&((1+stat.spell_haste)*(1+(mastery_value*2%4.5))>=1.3*(1.875+(1.25*0.226305)+1.25*(2*0.226305*stat.multistrike_pct%100)))&target.time_to_die>10&(buff.elemental_mastery.up|buff.bloodlust.up)
+		if not Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.3 * { 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 } and target.TimeToDie() > 10 and { BuffPresent(elemental_mastery_buff) or BuffPresent(burst_haste_buff any=1) } Spell(earthquake)
+		#earthquake,if=!talent.unleashed_fury.enabled&((1+stat.spell_haste)*(1+(mastery_value*2%4.5))>=(1.875+(1.25*0.226305)+1.25*(2*0.226305*stat.multistrike_pct%100)))&target.time_to_die>10&(buff.elemental_mastery.remains>=10|buff.bloodlust.remains>=10)
+		if not Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 and target.TimeToDie() > 10 and { BuffRemaining(elemental_mastery_buff) >= 10 or BuffRemaining(burst_haste_buff any=1) >= 10 } Spell(earthquake)
+		#earthquake,if=talent.unleashed_fury.enabled&((1+stat.spell_haste)*(1+(mastery_value*2%4.5))>=((1.3*1.875)+(1.25*0.226305)+1.25*(2*0.226305*stat.multistrike_pct%100)))&target.time_to_die>10&buff.elemental_mastery.down&buff.bloodlust.down
+		if Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.3 * 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 and target.TimeToDie() > 10 and BuffExpires(elemental_mastery_buff) and BuffExpires(burst_haste_buff any=1) Spell(earthquake)
+		#earthquake,if=talent.unleashed_fury.enabled&((1+stat.spell_haste)*(1+(mastery_value*2%4.5))>=1.3*((1.3*1.875)+(1.25*0.226305)+1.25*(2*0.226305*stat.multistrike_pct%100)))&target.time_to_die>10&(buff.elemental_mastery.up|buff.bloodlust.up)
+		if Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.3 * { 1.3 * 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 } and target.TimeToDie() > 10 and { BuffPresent(elemental_mastery_buff) or BuffPresent(burst_haste_buff any=1) } Spell(earthquake)
+		#earthquake,if=talent.unleashed_fury.enabled&((1+stat.spell_haste)*(1+(mastery_value*2%4.5))>=((1.3*1.875)+(1.25*0.226305)+1.25*(2*0.226305*stat.multistrike_pct%100)))&target.time_to_die>10&(buff.elemental_mastery.remains>=10|buff.bloodlust.remains>=10)
+		if Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.3 * 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 and target.TimeToDie() > 10 and { BuffRemaining(elemental_mastery_buff) >= 10 or BuffRemaining(burst_haste_buff any=1) >= 10 } Spell(earthquake)
+	}
+}
+
+AddFunction ElementalSingleCdActions
+{
 	unless Speed() > 0 and Spell(unleash_flame)
 	{
 		#spiritwalkers_grace,moving=1,if=buff.ascendance.up
 		if Speed() > 0 and BuffPresent(ascendance_caster_buff) Spell(spiritwalkers_grace)

-		unless BuffStacks(lightning_shield_buff) == SpellData(lightning_shield_buff max_stacks) and Spell(earth_shock)
-			or target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and { BuffPresent(ascendance_caster_buff) or not SpellCooldown(lava_burst) > 0 } and Spell(lava_burst)
-			or Talent(unleashed_fury_talent) and not BuffPresent(ascendance_caster_buff) and Spell(unleash_flame)
-			or target.DebuffRemaining(flame_shock_debuff) <= 9 and Spell(flame_shock)
-			or ArmorSetBonus(T17 4) and BuffStacks(lightning_shield_buff) >= 15 and not BuffPresent(lava_surge_buff) or not ArmorSetBonus(T17 4) and BuffStacks(lightning_shield_buff) > 15 and Spell(earth_shock)
+		unless BuffStacks(lightning_shield_buff) == SpellData(lightning_shield_buff max_stacks) and Spell(earth_shock) or target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and { BuffPresent(ascendance_caster_buff) or not SpellCooldown(lava_burst) > 0 } and Spell(lava_burst) or Talent(unleashed_fury_talent) and not BuffPresent(ascendance_caster_buff) and Spell(unleash_flame) or target.DebuffRemaining(flame_shock_debuff) <= 9 and Spell(flame_shock) or { ArmorSetBonus(T17 4) and BuffStacks(lightning_shield_buff) >= 15 and not BuffPresent(lava_surge_buff) or not ArmorSetBonus(T17 4) and BuffStacks(lightning_shield_buff) > 15 } and Spell(earth_shock) or not Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 and target.TimeToDie() > 10 and BuffExpires(elemental_mastery_buff) and BuffExpires(burst_haste_buff any=1) and Spell(earthquake) or not Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.3 * { 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 } and target.TimeToDie() > 10 and { BuffPresent(elemental_mastery_buff) or BuffPresent(burst_haste_buff any=1) } and Spell(earthquake) or not Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 and target.TimeToDie() > 10 and { BuffRemaining(elemental_mastery_buff) >= 10 or BuffRemaining(burst_haste_buff any=1) >= 10 } and Spell(earthquake) or Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.3 * 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 and target.TimeToDie() > 10 and BuffExpires(elemental_mastery_buff) and BuffExpires(burst_haste_buff any=1) and Spell(earthquake) or Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.3 * { 1.3 * 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 } and target.TimeToDie() > 10 and { BuffPresent(elemental_mastery_buff) or BuffPresent(burst_haste_buff any=1) } and Spell(earthquake) or Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.3 * 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 and target.TimeToDie() > 10 and { BuffRemaining(elemental_mastery_buff) >= 10 or BuffRemaining(burst_haste_buff any=1) >= 10 } and Spell(earthquake) or Spell(elemental_blast) or TimeInCombat() > 60 and target.DebuffRemaining(flame_shock_debuff) <= BaseDuration(ascendance_caster_buff) and SpellCooldown(ascendance_caster) + BaseDuration(ascendance_caster_buff) < BaseDuration(flame_shock_debuff) and Spell(flame_shock) or { not Talent(liquid_magma_talent) and not TotemPresent(fire) or Talent(liquid_magma_talent) and TotemRemaining(searing_totem) <= 20 and not TotemPresent(fire_elemental_totem) and not BuffPresent(liquid_magma_buff) } and Spell(searing_totem)
 		{
-			#earthquake,if=!talent.unleashed_fury.enabled&((1+stat.spell_haste)*(1+(mastery_value*2%4.5))>=(1.875+(1.25*0.226305)+1.25*(2*0.226305*stat.multistrike_pct%100)))&target.time_to_die>10&buff.elemental_mastery.down&buff.bloodlust.down
-			if not Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 and target.TimeToDie() > 10 and BuffExpires(elemental_mastery_buff) and BuffExpires(burst_haste_buff any=1) Spell(earthquake)
-			#earthquake,if=!talent.unleashed_fury.enabled&((1+stat.spell_haste)*(1+(mastery_value*2%4.5))>=1.3*(1.875+(1.25*0.226305)+1.25*(2*0.226305*stat.multistrike_pct%100)))&target.time_to_die>10&(buff.elemental_mastery.up|buff.bloodlust.up)
-			if not Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.3 * { 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 } and target.TimeToDie() > 10 and { BuffPresent(elemental_mastery_buff) or BuffPresent(burst_haste_buff any=1) } Spell(earthquake)
-			#earthquake,if=!talent.unleashed_fury.enabled&((1+stat.spell_haste)*(1+(mastery_value*2%4.5))>=(1.875+(1.25*0.226305)+1.25*(2*0.226305*stat.multistrike_pct%100)))&target.time_to_die>10&(buff.elemental_mastery.remains>=10|buff.bloodlust.remains>=10)
-			if not Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 and target.TimeToDie() > 10 and { BuffRemaining(elemental_mastery_buff) >= 10 or BuffRemaining(burst_haste_buff any=1) >= 10 } Spell(earthquake)
-			#earthquake,if=talent.unleashed_fury.enabled&((1+stat.spell_haste)*(1+(mastery_value*2%4.5))>=((1.3*1.875)+(1.25*0.226305)+1.25*(2*0.226305*stat.multistrike_pct%100)))&target.time_to_die>10&buff.elemental_mastery.down&buff.bloodlust.down
-			if Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.3 * 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 and target.TimeToDie() > 10 and BuffExpires(elemental_mastery_buff) and BuffExpires(burst_haste_buff any=1) Spell(earthquake)
-			#earthquake,if=talent.unleashed_fury.enabled&((1+stat.spell_haste)*(1+(mastery_value*2%4.5))>=1.3*((1.3*1.875)+(1.25*0.226305)+1.25*(2*0.226305*stat.multistrike_pct%100)))&target.time_to_die>10&(buff.elemental_mastery.up|buff.bloodlust.up)
-			if Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.3 * { 1.3 * 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 } and target.TimeToDie() > 10 and { BuffPresent(elemental_mastery_buff) or BuffPresent(burst_haste_buff any=1) } Spell(earthquake)
-			#earthquake,if=talent.unleashed_fury.enabled&((1+stat.spell_haste)*(1+(mastery_value*2%4.5))>=((1.3*1.875)+(1.25*0.226305)+1.25*(2*0.226305*stat.multistrike_pct%100)))&target.time_to_die>10&(buff.elemental_mastery.remains>=10|buff.bloodlust.remains>=10)
-			if Talent(unleashed_fury_talent) and { 1 + 100 / { 100 + SpellHaste() } } * { 1 + MasteryEffect() / 100 * 2 / 4.5 } >= 1.3 * 1.875 + 1.25 * 0.226305 + 1.25 * 2 * 0.226305 * MultistrikeChance() / 100 and target.TimeToDie() > 10 and { BuffRemaining(elemental_mastery_buff) >= 10 or BuffRemaining(burst_haste_buff any=1) >= 10 } Spell(earthquake)
-
-			unless Spell(elemental_blast)
-				or TimeInCombat() > 60 and target.DebuffRemaining(flame_shock_debuff) <= BaseDuration(ascendance_caster_buff) and SpellCooldown(ascendance_caster) + BaseDuration(ascendance_caster_buff) < BaseDuration(flame_shock_debuff) and Spell(flame_shock)
-				or not Talent(liquid_magma_talent) and not TotemPresent(fire) or Talent(liquid_magma_talent) and TotemRemaining(searing_totem) <= 20 and not TotemPresent(fire_elemental_totem) and not BuffPresent(liquid_magma_buff) and Spell(searing_totem)
-			{
-				#spiritwalkers_grace,moving=1,if=((talent.elemental_blast.enabled&cooldown.elemental_blast.remains=0)|(cooldown.lava_burst.remains=0&!buff.lava_surge.react))
-				if Speed() > 0 and { Talent(elemental_blast_talent) and not SpellCooldown(elemental_blast) > 0 or not SpellCooldown(lava_burst) > 0 and not BuffPresent(lava_surge_buff) } Spell(spiritwalkers_grace)
-			}
+			#spiritwalkers_grace,moving=1,if=((talent.elemental_blast.enabled&cooldown.elemental_blast.remains=0)|(cooldown.lava_burst.remains=0&!buff.lava_surge.react))
+			if Speed() > 0 and { Talent(elemental_blast_talent) and not SpellCooldown(elemental_blast) > 0 or not SpellCooldown(lava_burst) > 0 and not BuffPresent(lava_surge_buff) } Spell(spiritwalkers_grace)
 		}
 	}
 }

-AddFunction ElementalSingleCdActions {}
-
 ###
 ### Enhancement
 ###
@@ -233,24 +232,24 @@ AddFunction ElementalSingleCdActions {}
 #	talents=0001023
 #	glyphs=chain_lightning/frost_shock

-# ActionList: EnhancementDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction EnhancementDefaultActions
+AddFunction EnhancementDefaultMainActions
 {
 	#call_action_list,name=single,if=active_enemies=1
-	if Enemies() == 1 EnhancementSingleActions()
+	if Enemies() == 1 EnhancementSingleMainActions()
 	#call_action_list,name=aoe,if=active_enemies>1
-	if Enemies() > 1 EnhancementAoeActions()
+	if Enemies() > 1 EnhancementAoeMainActions()
 }

 AddFunction EnhancementDefaultShortCdActions
 {
 	#elemental_mastery
 	Spell(elemental_mastery)
-	#feral_spirit
-	Spell(feral_spirit)
 	#liquid_magma,if=pet.searing_totem.remains>=15|pet.magma_totem.remains>=15|pet.fire_elemental_totem.remains>=15
 	if TotemRemaining(searing_totem) >= 15 or TotemRemaining(magma_totem) >= 15 or TotemRemaining(fire_elemental_totem) >= 15 Spell(liquid_magma)
+	#ancestral_swiftness
+	Spell(ancestral_swiftness)
 }

 AddFunction EnhancementDefaultCdActions
@@ -259,6 +258,7 @@ AddFunction EnhancementDefaultCdActions
 	InterruptActions()
 	#bloodlust,if=target.health.pct<25|time>0.500
 	if target.HealthPercent() < 25 or TimeInCombat() > 0.5 Bloodlust()
+	#auto_attack
 	#use_item,name=beating_heart_of_the_mountain
 	UseItemActions()
 	#potion,name=draenic_agility,if=(talent.storm_elemental_totem.enabled&pet.storm_elemental_totem.remains>=25)|(!talent.storm_elemental_totem.enabled&pet.fire_elemental_totem.remains>=25)|target.time_to_die<=30
@@ -275,18 +275,13 @@ AddFunction EnhancementDefaultCdActions
 	if Talent(primal_elementalist_talent) and Enemies() <= 10 or Enemies() <= 6 Spell(fire_elemental_totem)
 	#ascendance
 	if BuffExpires(ascendance_melee_buff) Spell(ascendance_melee)
-
-	unless Spell(feral_spirit)
-		or { TotemRemaining(searing_totem) >= 15 or TotemRemaining(magma_totem) >= 15 or TotemRemaining(fire_elemental_totem) >= 15 } and Spell(liquid_magma)
-	{
-		#ancestral_swiftness
-		Spell(ancestral_swiftness)
-	}
+	#feral_spirit
+	Spell(feral_spirit)
 }

-# ActionList: EnhancementAoeActions --> main
+### actions.aoe

-AddFunction EnhancementAoeActions
+AddFunction EnhancementAoeMainActions
 {
 	#unleash_elements,if=active_enemies>=4&dot.flame_shock.ticking&(cooldown.shock.remains>cooldown.fire_nova.remains|cooldown.fire_nova.remains=0)
 	if Enemies() >= 4 and target.DebuffPresent(flame_shock_debuff) and { SpellCooldown(shock) > SpellCooldown(fire_nova) or not SpellCooldown(fire_nova) > 0 } Spell(unleash_elements)
@@ -334,31 +329,29 @@ AddFunction EnhancementAoeActions
 	}
 }

-# ActionList: EnhancementPrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction EnhancementPrecombatActions
+AddFunction EnhancementPrecombatMainActions
 {
 	#flask,type=greater_draenic_agility_flask
 	#food,type=frosty_stew
 	#lightning_shield,if=!buff.lightning_shield.up
 	if not BuffPresent(lightning_shield_buff) Spell(lightning_shield)
-	#snapshot_stats
 }

-AddFunction EnhancementPrecombatShortCdActions {}
-
 AddFunction EnhancementPrecombatCdActions
 {
 	unless not BuffPresent(lightning_shield_buff) and Spell(lightning_shield)
 	{
+		#snapshot_stats
 		#potion,name=draenic_agility
 		UsePotionAgility()
 	}
 }

-# ActionList: EnhancementSingleActions --> main
+### actions.single

-AddFunction EnhancementSingleActions
+AddFunction EnhancementSingleMainActions
 {
 	#searing_totem,if=!totem.fire.active
 	if not TotemPresent(fire) Spell(searing_totem)
@@ -467,37 +460,35 @@ AddCheckBox(opt_shaman_elemental_aoe L(AOE) specialization=elemental default)

 AddIcon specialization=elemental help=shortcd enemies=1 checkbox=!opt_shaman_elemental_aoe
 {
-	if InCombat(no) ElementalPrecombatShortCdActions()
 	ElementalDefaultShortCdActions()
 }

 AddIcon specialization=elemental help=shortcd checkbox=opt_shaman_elemental_aoe
 {
-	if InCombat(no) ElementalPrecombatShortCdActions()
 	ElementalDefaultShortCdActions()
 }

 AddIcon specialization=elemental help=main enemies=1
 {
-	if InCombat(no) ElementalPrecombatActions()
-	ElementalDefaultActions()
+	if not InCombat() ElementalPrecombatMainActions()
+	ElementalDefaultMainActions()
 }

 AddIcon specialization=elemental help=aoe checkbox=opt_shaman_elemental_aoe
 {
-	if InCombat(no) ElementalPrecombatActions()
-	ElementalDefaultActions()
+	if not InCombat() ElementalPrecombatMainActions()
+	ElementalDefaultMainActions()
 }

 AddIcon specialization=elemental help=cd enemies=1 checkbox=!opt_shaman_elemental_aoe
 {
-	if InCombat(no) ElementalPrecombatCdActions()
+	if not InCombat() ElementalPrecombatCdActions()
 	ElementalDefaultCdActions()
 }

 AddIcon specialization=elemental help=cd checkbox=opt_shaman_elemental_aoe
 {
-	if InCombat(no) ElementalPrecombatCdActions()
+	if not InCombat() ElementalPrecombatCdActions()
 	ElementalDefaultCdActions()
 }

@@ -506,37 +497,35 @@ AddCheckBox(opt_shaman_enhancement_aoe L(AOE) specialization=enhancement default

 AddIcon specialization=enhancement help=shortcd enemies=1 checkbox=!opt_shaman_enhancement_aoe
 {
-	if InCombat(no) EnhancementPrecombatShortCdActions()
 	EnhancementDefaultShortCdActions()
 }

 AddIcon specialization=enhancement help=shortcd checkbox=opt_shaman_enhancement_aoe
 {
-	if InCombat(no) EnhancementPrecombatShortCdActions()
 	EnhancementDefaultShortCdActions()
 }

 AddIcon specialization=enhancement help=main enemies=1
 {
-	if InCombat(no) EnhancementPrecombatActions()
-	EnhancementDefaultActions()
+	if not InCombat() EnhancementPrecombatMainActions()
+	EnhancementDefaultMainActions()
 }

 AddIcon specialization=enhancement help=aoe checkbox=opt_shaman_enhancement_aoe
 {
-	if InCombat(no) EnhancementPrecombatActions()
-	EnhancementDefaultActions()
+	if not InCombat() EnhancementPrecombatMainActions()
+	EnhancementDefaultMainActions()
 }

 AddIcon specialization=enhancement help=cd enemies=1 checkbox=!opt_shaman_enhancement_aoe
 {
-	if InCombat(no) EnhancementPrecombatCdActions()
+	if not InCombat() EnhancementPrecombatCdActions()
 	EnhancementDefaultCdActions()
 }

 AddIcon specialization=enhancement help=cd checkbox=opt_shaman_enhancement_aoe
 {
-	if InCombat(no) EnhancementPrecombatCdActions()
+	if not InCombat() EnhancementPrecombatCdActions()
 	EnhancementDefaultCdActions()
 }

diff --git a/scripts/ovale_warlock.lua b/scripts/ovale_warlock.lua
index 0cc9d44..0241f7f 100644
--- a/scripts/ovale_warlock.lua
+++ b/scripts/ovale_warlock.lua
@@ -33,23 +33,9 @@ AddFunction UseItemActions
 #	talents=0000113
 #	pet=felhunter

-# ActionList: AfflictionDefaultActions --> main, predict, shortcd, cd
+### actions.default

-AddFunction AfflictionDefaultActions
-{
-	AfflictionDefaultPredictActions()
-
-	#life_tap,if=mana.pct<40
-	if ManaPercent() < 40 Spell(life_tap)
-	#drain_soul,interrupt=1,chain=1
-	Spell(drain_soul)
-	#agony,cycle_targets=1,moving=1,if=mana.pct>50
-	if Speed() > 0 and ManaPercent() > 50 Spell(agony)
-	#life_tap
-	Spell(life_tap)
-}
-
-AddFunction AfflictionDefaultPredictActions
+AddFunction AfflictionDefaultMainActions
 {
 	# CHANGE: Ovale doesn't know about mana costs so check for using Life Tap much earlier.
 	if ManaPercent() < 40 Spell(life_tap)
@@ -63,6 +49,14 @@ AddFunction AfflictionDefaultPredictActions
 	if target.TimeToDie() > 10 and target.DebuffRemaining(unstable_affliction_debuff) <= BaseDuration(unstable_affliction_debuff) * 0.3 Spell(unstable_affliction)
 	#corruption,cycle_targets=1,if=target.time_to_die>12&remains<=(duration*0.3)
 	if target.TimeToDie() > 12 and target.DebuffRemaining(corruption_debuff) <= BaseDuration(corruption_debuff) * 0.3 Spell(corruption)
+	#life_tap,if=mana.pct<40
+	if ManaPercent() < 40 Spell(life_tap)
+	#drain_soul,interrupt=1,chain=1
+	Spell(drain_soul)
+	#agony,cycle_targets=1,moving=1,if=mana.pct>50
+	if Speed() > 0 and ManaPercent() > 50 Spell(agony)
+	#life_tap
+	Spell(life_tap)
 }

 AddFunction AfflictionDefaultShortCdActions
@@ -71,10 +65,14 @@ AddFunction AfflictionDefaultShortCdActions
 	Spell(mannoroths_fury)
 	#service_pet,if=talent.grimoire_of_service.enabled
 	if Talent(grimoire_of_service_talent) Spell(grimoire_felhunter)
+	#kiljaedens_cunning,if=(talent.cataclysm.enabled&!cooldown.cataclysm.remains)
+	if Talent(cataclysm_talent) and not SpellCooldown(cataclysm) > 0 Spell(kiljaedens_cunning)
+	#kiljaedens_cunning,moving=1,if=!talent.cataclysm.enabled
+	if Speed() > 0 and not Talent(cataclysm_talent) Spell(kiljaedens_cunning)
 	#cataclysm
 	Spell(cataclysm)

-	unless SoulShards() >= 1 and not Talent(soulburn_haunt_talent) and not InFlightToTarget(haunt) and { target.DebuffRemaining(haunt_debuff) < CastTime(haunt) + 0.5 or SoulShards() == 4 } and { BuffPresent(trinket_proc_any_buff) or BuffStacks(trinket_stacking_proc_any_buff) > 6 or BuffPresent(dark_soul_misery_buff) or SoulShards() > 2 or SoulShards() * 14 <= target.TimeToDie() } and Spell(haunt)
+	unless SoulShards() >= 1 and not Talent(soulburn_haunt_talent) and not InFlightToTarget(haunt) and { target.DebuffRemaining(haunt_debuff) < CastTime(haunt) + MaxTravelTime(haunt) or SoulShards() == 4 } and { BuffPresent(trinket_proc_any_buff) or BuffStacks(trinket_stacking_proc_any_buff) > 6 or BuffPresent(dark_soul_misery_buff) or SoulShards() > 2 or SoulShards() * 14 <= target.TimeToDie() } and Spell(haunt)
 	{
 		#soulburn,if=shard_react&talent.soulburn_haunt.enabled&buff.soulburn.down&(buff.haunting_spirits.down|soul_shard=4&buff.haunting_spirits.remains<5)
 		if SoulShards() >= 1 and Talent(soulburn_haunt_talent) and BuffExpires(soulburn_buff) and { BuffExpires(haunting_spirits_buff) or SoulShards() == 4 and BuffRemaining(haunting_spirits_buff) < 5 } Spell(soulburn)
@@ -103,14 +101,9 @@ AddFunction AfflictionDefaultCdActions
 	}
 }

-# ActionList: AfflictionPrecombatActions --> main, predict, shortcd, cd
+### actions.precombat

-AddFunction AfflictionPrecombatActions
-{
-	AfflictionPrecombatPredictActions()
-}
-
-AddFunction AfflictionPrecombatPredictActions
+AddFunction AfflictionPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=sleeper_surprise
@@ -134,8 +127,7 @@ AddFunction AfflictionPrecombatShortCdActions

 AddFunction AfflictionPrecombatCdActions
 {
-	unless not BuffPresent(spell_power_multiplier_buff any=1) and Spell(dark_intent)
-		or not Talent(demonic_servitude_talent) and { not Talent(grimoire_of_sacrifice_talent) or BuffExpires(grimoire_of_sacrifice_buff) } and not pet.Present() and Spell(summon_felhunter)
+	unless not BuffPresent(spell_power_multiplier_buff any=1) and Spell(dark_intent) or not Talent(demonic_servitude_talent) and { not Talent(grimoire_of_sacrifice_talent) or BuffExpires(grimoire_of_sacrifice_buff) } and not pet.Present() and Spell(summon_felhunter)
 	{
 		#summon_doomguard,if=talent.demonic_servitude.enabled&active_enemies<5
 		if Talent(demonic_servitude_talent) and Enemies() < 5 Spell(summon_doomguard)
@@ -160,9 +152,9 @@ AddFunction AfflictionPrecombatCdActions
 #	glyphs=dark_soul
 #	pet=felguard

-# ActionList: DemonologyDefaultActions --> main, predict, shortcd, cd
+### actions.default

-AddFunction DemonologyDefaultActions
+AddFunction DemonologyDefaultMainActions
 {
 	# CHANGE: Ovale doesn't know about mana costs so check for using Life Tap much earlier.
 	if not BuffPresent(metamorphosis_buff) and ManaPercent() < 40 Spell(life_tap)
@@ -171,33 +163,31 @@ AddFunction DemonologyDefaultActions
 	#hand_of_guldan,if=!in_flight&dot.shadowflame.remains<travel_time+action.shadow_bolt.cast_time&talent.demonbolt.enabled&((set_bonus.tier17_4pc=0&((charges=1&recharge_time<4)|charges=2))|(charges=3|(charges=2&recharge_time<13.8-travel_time*2))|dot.shadowflame.remains>travel_time)
 	if not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and Talent(demonbolt_talent) and { ArmorSetBonus(T17 4) == 0 and { Charges(hand_of_guldan) == 1 and SpellChargeCooldown(hand_of_guldan) < 4 or Charges(hand_of_guldan) == 2 } or Charges(hand_of_guldan) == 3 or Charges(hand_of_guldan) == 2 and SpellChargeCooldown(hand_of_guldan) < 13.8 - MaxTravelTime(hand_of_guldan) * 2 or target.DebuffRemaining(shadowflame_debuff) > MaxTravelTime(hand_of_guldan) } Spell(hand_of_guldan)
 	#hand_of_guldan,if=!in_flight&dot.shadowflame.remains<travel_time+3&buff.demonbolt.remains<gcd*2&charges>=2&action.dark_soul.charges>=1
-	if not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(haunt) + 3 and BuffRemaining(demonbolt_buff) < GCD() * 2 and Charges(hand_of_guldan) >= 2 and Charges(dark_soul_knowledge) >= 1 Spell(hand_of_guldan)
-	#service_pet,if=talent.grimoire_of_service.enabled&!talent.demonbolt.enabled
-	if Talent(grimoire_of_service_talent) and not Talent(demonbolt_talent) Spell(grimoire_felguard)
+	if not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + 3 and BuffRemaining(demonbolt_buff) < GCD() * 2 and Charges(hand_of_guldan) >= 2 and Charges(dark_soul_knowledge) >= 1 Spell(hand_of_guldan)
 	#call_action_list,name=db,if=talent.demonbolt.enabled
-	if Talent(demonbolt_talent) DemonologyDbActions()
+	if Talent(demonbolt_talent) DemonologyDbMainActions()
 	#immolation_aura,if=demonic_fury>450&active_enemies>=3&buff.immolation_aura.down
 	if DemonicFury() > 450 and Enemies() >= 3 and BuffExpires(immolation_aura_buff) Spell(immolation_aura)
-	#doom,if=buff.metamorphosis.up&target.time_to_die>=30*spell_haste&remains<=(duration*0.3)&(remains<cooldown.cataclysm.remains|!talent.cataclysm.enabled)&(buff.dark_soul.down|!glyph.dark_soul.enabled)
+	#doom,if=buff.metamorphosis.up&target.time_to_die>=30*spell_haste&remains<=(duration*0.3)&(remains<cooldown.cataclysm.remains|!talent.cataclysm.enabled)&(buff.dark_soul.down|!glyph.dark_soul.enabled)&trinket.stacking_proc.multistrike.react<10
 	if BuffPresent(metamorphosis_buff) and target.TimeToDie() >= 30 * 100 / { 100 + SpellHaste() } and target.DebuffRemaining(doom_debuff) <= BaseDuration(doom_debuff) * 0.3 and { target.DebuffRemaining(doom_debuff) < SpellCooldown(cataclysm) or not Talent(cataclysm_talent) } and { BuffExpires(dark_soul_knowledge_buff) or not Glyph(glyph_of_dark_soul) } and BuffStacks(trinket_stacking_proc_multistrike_buff) < 10 Spell(doom)
 	#corruption,cycle_targets=1,if=target.time_to_die>=6&remains<=(0.3*duration)&buff.metamorphosis.down
 	if target.TimeToDie() >= 6 and target.DebuffRemaining(corruption_debuff) <= 0.3 * BaseDuration(corruption_debuff) and BuffExpires(metamorphosis_buff) Spell(corruption)
-	#cancel_metamorphosis,if=buff.metamorphosis.up&((demonic_fury<650&!glyph.dark_soul.enabled)|demonic_fury<450)&buff.dark_soul.down&(trinket.proc.crit.down&trinket.stacking_proc.multistrike.down&trinket.proc.mastery.down&trinket.proc.intellect.down&trinket.proc.multistrike.down&trinket.proc.versatility.down&trinket.proc.spellpower.down|demonic_fury<(800-cooldown.dark_soul.remains*(10%spell_haste)))&target.time_to_die>20
-	if BuffPresent(metamorphosis_buff) and { DemonicFury() < 650 and not Glyph(glyph_of_dark_soul) or DemonicFury() < 450 } and BuffExpires(dark_soul_knowledge_buff) and { BuffExpires(trinket_proc_crit_buff) and BuffExpires(trinket_stacking_proc_multistrike_buff) and BuffExpires(trinket_proc_mastery_buff) and BuffExpires(trinket_proc_intellect_buff) and BuffExpires(trinket_proc_multistrike_buff) and BuffExpires(trinket_proc_versatility_buff) and BuffExpires(trinket_proc_spellpower_buff) or DemonicFury() < 800 - SpellCooldown(dark_soul_knowledge) * 10 / { SpellHaste() / 100 } } and target.TimeToDie() > 20 and BuffPresent(metamorphosis_buff) Spell(metamorphosis text=cancel)
+	#cancel_metamorphosis,if=buff.metamorphosis.up&((demonic_fury<650&!glyph.dark_soul.enabled)|demonic_fury<450)&buff.dark_soul.down&(trinket.stacking_proc.multistrike.down&trinket.proc.any.down|demonic_fury<(800-cooldown.dark_soul.remains*(10%spell_haste)))&target.time_to_die>20
+	if BuffPresent(metamorphosis_buff) and { DemonicFury() < 650 and not Glyph(glyph_of_dark_soul) or DemonicFury() < 450 } and BuffExpires(dark_soul_knowledge_buff) and { BuffExpires(trinket_stacking_proc_multistrike_buff) and BuffExpires(trinket_proc_any_buff) or DemonicFury() < 800 - SpellCooldown(dark_soul_knowledge) * 10 / { 100 / { 100 + SpellHaste() } } } and target.TimeToDie() > 20 and BuffPresent(metamorphosis_buff) Spell(metamorphosis text=cancel)
 	#cancel_metamorphosis,if=buff.metamorphosis.up&action.hand_of_guldan.charges>0&dot.shadowflame.remains<action.hand_of_guldan.travel_time+action.shadow_bolt.cast_time&demonic_fury<100&buff.dark_soul.remains>10
 	if BuffPresent(metamorphosis_buff) and Charges(hand_of_guldan) > 0 and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and DemonicFury() < 100 and BuffRemaining(dark_soul_knowledge_buff) > 10 and BuffPresent(metamorphosis_buff) Spell(metamorphosis text=cancel)
 	#cancel_metamorphosis,if=buff.metamorphosis.up&action.hand_of_guldan.charges=3&(!buff.dark_soul.remains>gcd|action.metamorphosis.cooldown<gcd)
 	if BuffPresent(metamorphosis_buff) and Charges(hand_of_guldan) == 3 and { not BuffRemaining(dark_soul_knowledge_buff) > GCD() or SpellCooldown(metamorphosis) < GCD() } and BuffPresent(metamorphosis_buff) Spell(metamorphosis text=cancel)
 	#chaos_wave,if=buff.metamorphosis.up&(buff.dark_soul.up&active_enemies>=3|(charges=3|set_bonus.tier17_4pc=0&charges=2))
 	if BuffPresent(metamorphosis_buff) and { BuffPresent(dark_soul_knowledge_buff) and Enemies() >= 3 or Charges(chaos_wave) == 3 or ArmorSetBonus(T17 4) == 0 and Charges(chaos_wave) == 2 } Spell(chaos_wave)
-	#soul_fire,if=buff.metamorphosis.up&buff.molten_core.react&(buff.dark_soul.remains>execute_time|target.health.pct<=25)&(((buff.molten_core.stack*execute_time>=trinket.stacking_proc.multistrike.remains-1|demonic_fury<=ceil((trinket.stacking_proc.multistrike.remains-buff.molten_core.stack*execute_time)*40)+80*buff.molten_core.stack)|target.health.pct<=25)&trinket.stacking_proc.multistrike.remains>=execute_time|trinket.stacking_proc.multistrike.down)
-	if BuffPresent(metamorphosis_buff) and BuffPresent(molten_core_buff) and { BuffRemaining(dark_soul_knowledge_buff) > ExecuteTime(soul_fire) or target.HealthPercent() <= 25 } and { { BuffStacks(molten_core_buff) * ExecuteTime(soul_fire) >= BuffRemaining(trinket_stacking_proc_multistrike_buff) - 1 or DemonicFury() <= { BuffRemaining(trinket_stacking_proc_multistrike_buff) - BuffStacks(molten_core_buff) * ExecuteTime(soul_fire) } * 40 + 80 * BuffStacks(molten_core_buff) or target.HealthPercent() <= 25 } and BuffRemaining(trinket_stacking_proc_multistrike_buff) >= ExecuteTime(soul_fire) or BuffExpires(trinket_stacking_proc_multistrike_buff) } Spell(soul_fire)
+	#soul_fire,if=buff.metamorphosis.up&buff.molten_core.react&(buff.dark_soul.remains>execute_time|target.health.pct<=25)&(((buff.molten_core.stack*execute_time>=trinket.stacking_proc.multistrike.remains-1|demonic_fury<=ceil((trinket.stacking_proc.multistrike.remains-buff.molten_core.stack*execute_time)*40)+80*buff.molten_core.stack)|target.health.pct<=25)&trinket.stacking_proc.multistrike.remains>=execute_time|trinket.stacking_proc.multistrike.down|!trinket.has_stacking_proc.multistrike)
+	if BuffPresent(metamorphosis_buff) and BuffPresent(molten_core_buff any=1) and { BuffRemaining(dark_soul_knowledge_buff) > ExecuteTime(soul_fire) or target.HealthPercent() <= 25 } and { { BuffStacks(molten_core_buff any=1) * ExecuteTime(soul_fire) >= BuffRemaining(trinket_stacking_proc_multistrike_buff) - 1 or DemonicFury() <= { BuffRemaining(trinket_stacking_proc_multistrike_buff) - BuffStacks(molten_core_buff any=1) * ExecuteTime(soul_fire) } * 40 + 80 * BuffStacks(molten_core_buff any=1) or target.HealthPercent() <= 25 } and BuffRemaining(trinket_stacking_proc_multistrike_buff) >= ExecuteTime(soul_fire) or BuffExpires(trinket_stacking_proc_multistrike_buff) or not True(trinket_has_stacking_proc_multistrike) } Spell(soul_fire)
 	#touch_of_chaos,cycle_targets=1,if=buff.metamorphosis.up&dot.corruption.remains<17.4&demonic_fury>750
 	if BuffPresent(metamorphosis_buff) and target.DebuffRemaining(corruption_debuff) < 17.4 and DemonicFury() > 750 Spell(touch_of_chaos)
 	#touch_of_chaos,if=buff.metamorphosis.up
 	if BuffPresent(metamorphosis_buff) Spell(touch_of_chaos)
-	#metamorphosis,if=buff.dark_soul.remains>gcd&(demonic_fury>300|!glyph.dark_soul.enabled)
-	if BuffRemaining(dark_soul_knowledge_buff) > GCD() and { DemonicFury() > 300 or not Glyph(glyph_of_dark_soul) } Spell(metamorphosis)
+	#metamorphosis,if=buff.dark_soul.remains>gcd&(demonic_fury>300|!glyph.dark_soul.enabled)&(demonic_fury>=80&buff.molten_core.stack>=1|demonic_fury>=40)
+	if BuffRemaining(dark_soul_knowledge_buff) > GCD() and { DemonicFury() > 300 or not Glyph(glyph_of_dark_soul) } and { DemonicFury() >= 80 and BuffStacks(molten_core_buff any=1) >= 1 or DemonicFury() >= 40 } Spell(metamorphosis)
 	#metamorphosis,if=(trinket.stacking_proc.multistrike.react|trinket.proc.any.react)&((demonic_fury>450&action.dark_soul.recharge_time>=10&glyph.dark_soul.enabled)|(demonic_fury>650&cooldown.dark_soul.remains>=10))
 	if { BuffPresent(trinket_stacking_proc_multistrike_buff) or BuffPresent(trinket_proc_any_buff) } and { DemonicFury() > 450 and SpellChargeCooldown(dark_soul_knowledge) >= 10 and Glyph(glyph_of_dark_soul) or DemonicFury() > 650 and SpellCooldown(dark_soul_knowledge) >= 10 } Spell(metamorphosis)
 	#metamorphosis,if=!cooldown.cataclysm.remains&talent.cataclysm.enabled
@@ -212,10 +202,10 @@ AddFunction DemonologyDefaultActions
 	if BuffPresent(metamorphosis_buff) Spell(metamorphosis text=cancel)
 	#hellfire,interrupt=1,if=active_enemies>=5
 	if Enemies() >= 5 Spell(hellfire)
-	#soul_fire,if=buff.molten_core.react&(buff.molten_core.stack>=7|target.health.pct<=25|(buff.dark_soul.remains&cooldown.metamorphosis.remains>buff.dark_soul.remains)|trinket.proc.crit.remains>execute_time|trinket.stacking_proc.multistrike.remains>execute_time)&(buff.dark_soul.remains<action.shadow_bolt.cast_time|buff.dark_soul.remains>execute_time)
-	if BuffPresent(molten_core_buff) and { BuffStacks(molten_core_buff) >= 7 or target.HealthPercent() <= 25 or BuffPresent(dark_soul_knowledge_buff) and SpellCooldown(metamorphosis) > BuffRemaining(dark_soul_knowledge_buff) or BuffRemaining(trinket_proc_crit_buff) > ExecuteTime(soul_fire) or BuffRemaining(trinket_stacking_proc_multistrike_buff) > ExecuteTime(soul_fire) } and { BuffRemaining(dark_soul_knowledge_buff) < CastTime(shadow_bolt) or BuffRemaining(dark_soul_knowledge_buff) > ExecuteTime(soul_fire) } Spell(soul_fire)
+	#soul_fire,if=buff.molten_core.react&(buff.molten_core.stack>=7|target.health.pct<=25|(buff.dark_soul.remains&cooldown.metamorphosis.remains>buff.dark_soul.remains)|trinket.proc.any.remains>execute_time|trinket.stacking_proc.multistrike.remains>execute_time)&(buff.dark_soul.remains<action.shadow_bolt.cast_time|buff.dark_soul.remains>execute_time)
+	if BuffPresent(molten_core_buff any=1) and { BuffStacks(molten_core_buff any=1) >= 7 or target.HealthPercent() <= 25 or BuffPresent(dark_soul_knowledge_buff) and SpellCooldown(metamorphosis) > BuffRemaining(dark_soul_knowledge_buff) or BuffRemaining(trinket_proc_any_buff) > ExecuteTime(soul_fire) or BuffRemaining(trinket_stacking_proc_multistrike_buff) > ExecuteTime(soul_fire) } and { BuffRemaining(dark_soul_knowledge_buff) < CastTime(shadow_bolt) or BuffRemaining(dark_soul_knowledge_buff) > ExecuteTime(soul_fire) } Spell(soul_fire)
 	#soul_fire,if=buff.molten_core.react&target.time_to_die<(time+target.time_to_die)*0.25+cooldown.dark_soul.remains
-	if BuffPresent(molten_core_buff) and target.TimeToDie() < { TimeInCombat() + target.TimeToDie() } * 0.25 + SpellCooldown(dark_soul_knowledge) Spell(soul_fire)
+	if BuffPresent(molten_core_buff any=1) and target.TimeToDie() < { TimeInCombat() + target.TimeToDie() } * 0.25 + SpellCooldown(dark_soul_knowledge) Spell(soul_fire)
 	#life_tap,if=mana.pct<40
 	if ManaPercent() < 40 Spell(life_tap)
 	#hellfire,interrupt=1,if=active_enemies>=4
@@ -228,65 +218,6 @@ AddFunction DemonologyDefaultActions
 	Spell(life_tap)
 }

-AddFunction DemonologyDefaultPredictActions
-{
-	# CHANGE: Ovale doesn't know about mana costs so check for using Life Tap much earlier.
-	if not BuffPresent(metamorphosis_buff) and ManaPercent() < 40 Spell(life_tap)
-	#hand_of_guldan,if=!in_flight&dot.shadowflame.remains<travel_time+action.shadow_bolt.cast_time&(((set_bonus.tier17_4pc=0&((charges=1&recharge_time<4)|charges=2))|(charges=3|(charges=2&recharge_time<13.8-travel_time*2))&(cooldown.cataclysm.remains>dot.shadowflame.duration|!talent.cataclysm.enabled)&cooldown.dark_soul.remains>dot.shadowflame.duration)|dot.shadowflame.remains>travel_time)
-	if not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and { ArmorSetBonus(T17 4) == 0 and { Charges(hand_of_guldan) == 1 and SpellChargeCooldown(hand_of_guldan) < 4 or Charges(hand_of_guldan) == 2 } or { Charges(hand_of_guldan) == 3 or Charges(hand_of_guldan) == 2 and SpellChargeCooldown(hand_of_guldan) < 13.8 - MaxTravelTime(hand_of_guldan) * 2 } and { SpellCooldown(cataclysm) > target.DebuffDuration(shadowflame_debuff) or not Talent(cataclysm_talent) } and SpellCooldown(dark_soul_knowledge) > target.DebuffDuration(shadowflame_debuff) or target.DebuffRemaining(shadowflame_debuff) > MaxTravelTime(hand_of_guldan) } Spell(hand_of_guldan)
-	#hand_of_guldan,if=!in_flight&dot.shadowflame.remains<travel_time+action.shadow_bolt.cast_time&talent.demonbolt.enabled&((set_bonus.tier17_4pc=0&((charges=1&recharge_time<4)|charges=2))|(charges=3|(charges=2&recharge_time<13.8-travel_time*2))|dot.shadowflame.remains>travel_time)
-	if not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and Talent(demonbolt_talent) and { ArmorSetBonus(T17 4) == 0 and { Charges(hand_of_guldan) == 1 and SpellChargeCooldown(hand_of_guldan) < 4 or Charges(hand_of_guldan) == 2 } or Charges(hand_of_guldan) == 3 or Charges(hand_of_guldan) == 2 and SpellChargeCooldown(hand_of_guldan) < 13.8 - MaxTravelTime(hand_of_guldan) * 2 or target.DebuffRemaining(shadowflame_debuff) > MaxTravelTime(hand_of_guldan) } Spell(hand_of_guldan)
-	#hand_of_guldan,if=!in_flight&dot.shadowflame.remains<travel_time+3&buff.demonbolt.remains<gcd*2&charges>=2&action.dark_soul.charges>=1
-	if not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(haunt) + 3 and BuffRemaining(demonbolt_buff) < GCD() * 2 and Charges(hand_of_guldan) >= 2 and Charges(dark_soul_knowledge) >= 1 Spell(hand_of_guldan)
-	#service_pet,if=talent.grimoire_of_service.enabled&!talent.demonbolt.enabled
-	if Talent(grimoire_of_service_talent) and not Talent(demonbolt_talent) Spell(grimoire_felguard)
-	#call_action_list,name=db,if=talent.demonbolt.enabled
-	if Talent(demonbolt_talent) DemonologyDbPredictActions()
-	#immolation_aura,if=demonic_fury>450&active_enemies>=3&buff.immolation_aura.down
-	if DemonicFury() > 450 and Enemies() >= 3 and BuffExpires(immolation_aura_buff) Spell(immolation_aura)
-	#doom,if=buff.metamorphosis.up&target.time_to_die>=30*spell_haste&remains<=(duration*0.3)&(remains<cooldown.cataclysm.remains|!talent.cataclysm.enabled)&(buff.dark_soul.down|!glyph.dark_soul.enabled)&trinket.stacking_proc.multistrike.react<10
-	if BuffPresent(metamorphosis_buff) and target.TimeToDie() >= 30 * 100 / { 100 + SpellHaste() } and target.DebuffRemaining(doom_debuff) <= BaseDuration(doom_debuff) * 0.3 and { target.DebuffRemaining(doom_debuff) < SpellCooldown(cataclysm) or not Talent(cataclysm_talent) } and { BuffExpires(dark_soul_knowledge_buff) or not Glyph(glyph_of_dark_soul) } and BuffStacks(trinket_stacking_proc_multistrike_buff) < 10 Spell(doom)
-	#corruption,cycle_targets=1,if=target.time_to_die>=6&remains<=(0.3*duration)&buff.metamorphosis.down
-	if target.TimeToDie() >= 6 and target.DebuffRemaining(corruption_debuff) <= 0.3 * BaseDuration(corruption_debuff) and BuffExpires(metamorphosis_buff) Spell(corruption)
-	#cancel_metamorphosis,if=buff.metamorphosis.up&((demonic_fury<650&!glyph.dark_soul.enabled)|demonic_fury<450)&buff.dark_soul.down&(trinket.stacking_proc.multistrike.down&trinket.proc.any.down|demonic_fury<(800-cooldown.dark_soul.remains*(10%spell_haste)))&target.time_to_die>20
-	if BuffPresent(metamorphosis_buff) and { DemonicFury() < 650 and not Glyph(glyph_of_dark_soul) or DemonicFury() < 450 } and BuffExpires(dark_soul_knowledge_buff) and { BuffExpires(trinket_stacking_proc_multistrike_buff) and BuffExpires(trinket_proc_any_buff) or DemonicFury() < 800 - SpellCooldown(dark_soul_knowledge) * 10 / { 100 / { 100 + SpellHaste() } } } and target.TimeToDie() > 20 and BuffPresent(metamorphosis_buff) Spell(metamorphosis text=cancel)
-	#cancel_metamorphosis,if=buff.metamorphosis.up&action.hand_of_guldan.charges>0&dot.shadowflame.remains<action.hand_of_guldan.travel_time+action.shadow_bolt.cast_time&demonic_fury<100&buff.dark_soul.remains>10
-	if BuffPresent(metamorphosis_buff) and Charges(hand_of_guldan) > 0 and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and DemonicFury() < 100 and BuffRemaining(dark_soul_knowledge_buff) > 10 and BuffPresent(metamorphosis_buff) Spell(metamorphosis text=cancel)
-	#cancel_metamorphosis,if=buff.metamorphosis.up&action.hand_of_guldan.charges=3&(!buff.dark_soul.remains>gcd|action.metamorphosis.cooldown<gcd)
-	if BuffPresent(metamorphosis_buff) and Charges(hand_of_guldan) == 3 and { not BuffRemaining(dark_soul_knowledge_buff) > GCD() or SpellCooldown(metamorphosis) < GCD() } and BuffPresent(metamorphosis_buff) Spell(metamorphosis text=cancel)
-	#chaos_wave,if=buff.metamorphosis.up&(buff.dark_soul.up&active_enemies>=3|(charges=3|set_bonus.tier17_4pc=0&charges=2))
-	if BuffPresent(metamorphosis_buff) and { BuffPresent(dark_soul_knowledge_buff) and Enemies() >= 3 or Charges(chaos_wave) == 3 or ArmorSetBonus(T17 4) == 0 and Charges(chaos_wave) == 2 } Spell(chaos_wave)
-	#soul_fire,if=buff.metamorphosis.up&buff.molten_core.react&(buff.dark_soul.remains>execute_time|target.health.pct<=25)&(((buff.molten_core.stack*execute_time>=trinket.stacking_proc.multistrike.remains-1|demonic_fury<=ceil((trinket.stacking_proc.multistrike.remains-buff.molten_core.stack*execute_time)*40)+80*buff.molten_core.stack)|target.health.pct<=25)&trinket.stacking_proc.multistrike.remains>=execute_time|trinket.stacking_proc.multistrike.down|!trinket.has_stacking_proc.multistrike)
-	if BuffPresent(metamorphosis_buff) and BuffPresent(molten_core_buff) and { BuffRemaining(dark_soul_knowledge_buff) > ExecuteTime(soul_fire) or target.HealthPercent() <= 25 } and { { BuffStacks(molten_core_buff) * ExecuteTime(soul_fire) >= BuffRemaining(trinket_stacking_proc_multistrike_buff) - 1 or DemonicFury() <= { BuffRemaining(trinket_stacking_proc_multistrike_buff) - BuffStacks(molten_core_buff) * ExecuteTime(soul_fire) } * 40 + 80 * BuffStacks(molten_core_buff) or target.HealthPercent() <= 25 } and BuffRemaining(trinket_stacking_proc_multistrike_buff) >= ExecuteTime(soul_fire) or BuffExpires(trinket_stacking_proc_multistrike_buff) or not True(trinket_has_stacking_proc_multistrike) } Spell(soul_fire)
-
-	unless BuffPresent(metamorphosis_buff) and target.DebuffRemaining(corruption_debuff) < 17.4 and DemonicFury() > 750 and Spell(touch_of_chaos)
-		or BuffPresent(metamorphosis_buff) and Spell(touch_of_chaos)
-	{
-		#metamorphosis,if=buff.dark_soul.remains>gcd&(demonic_fury>300|!glyph.dark_soul.enabled)
-		if BuffRemaining(dark_soul_knowledge_buff) > GCD() and { DemonicFury() > 300 or not Glyph(glyph_of_dark_soul) } Spell(metamorphosis)
-		#metamorphosis,if=(trinket.stacking_proc.multistrike.react|trinket.proc.any.react)&((demonic_fury>450&action.dark_soul.recharge_time>=10&glyph.dark_soul.enabled)|(demonic_fury>650&cooldown.dark_soul.remains>=10))
-		if { BuffPresent(trinket_stacking_proc_multistrike_buff) or BuffPresent(trinket_proc_any_buff) } and { DemonicFury() > 450 and SpellChargeCooldown(dark_soul_knowledge) >= 10 and Glyph(glyph_of_dark_soul) or DemonicFury() > 650 and SpellCooldown(dark_soul_knowledge) >= 10 } Spell(metamorphosis)
-		#metamorphosis,if=!cooldown.cataclysm.remains&talent.cataclysm.enabled
-		if not SpellCooldown(cataclysm) > 0 and Talent(cataclysm_talent) Spell(metamorphosis)
-		#metamorphosis,if=!dot.doom.ticking&target.time_to_die>=30%(1%spell_haste)&demonic_fury>300
-		if not target.DebuffPresent(doom_debuff) and target.TimeToDie() >= 30 / { 1 / { 100 / { 100 + SpellHaste() } } } and DemonicFury() > 300 Spell(metamorphosis)
-		#metamorphosis,if=(demonic_fury>750&(action.hand_of_guldan.charges=0|(!dot.shadowflame.ticking&!action.hand_of_guldan.in_flight_to_target)))|floor(demonic_fury%80)*action.soul_fire.execute_time>=target.time_to_die
-		if DemonicFury() > 750 and { Charges(hand_of_guldan) == 0 or not target.DebuffPresent(shadowflame_debuff) and not InFlightToTarget(hand_of_guldan) } or DemonicFury() / 80 * ExecuteTime(soul_fire) >= target.TimeToDie() Spell(metamorphosis)
-		#metamorphosis,if=demonic_fury>=950
-		if DemonicFury() >= 950 Spell(metamorphosis)
-		#cancel_metamorphosis
-		if BuffPresent(metamorphosis_buff) Spell(metamorphosis text=cancel)
-
-		unless Enemies() >= 5 and Spell(hellfire)
-		{
-			#soul_fire,if=buff.molten_core.react&(buff.molten_core.stack>=7|target.health.pct<=25|(buff.dark_soul.remains&cooldown.metamorphosis.remains>buff.dark_soul.remains)|trinket.proc.any.remains>execute_time|trinket.stacking_proc.multistrike.remains>execute_time)&(buff.dark_soul.remains<action.shadow_bolt.cast_time|buff.dark_soul.remains>execute_time)
-			if BuffPresent(molten_core_buff) and { BuffStacks(molten_core_buff) >= 7 or target.HealthPercent() <= 25 or BuffPresent(dark_soul_knowledge_buff) and SpellCooldown(metamorphosis) > BuffRemaining(dark_soul_knowledge_buff) or BuffRemaining(trinket_proc_any_buff) > ExecuteTime(soul_fire) or BuffRemaining(trinket_stacking_proc_multistrike_buff) > ExecuteTime(soul_fire) } and { BuffRemaining(dark_soul_knowledge_buff) < CastTime(shadow_bolt) or BuffRemaining(dark_soul_knowledge_buff) > ExecuteTime(soul_fire) } Spell(soul_fire)
-			#soul_fire,if=buff.molten_core.react&target.time_to_die<(time+target.time_to_die)*0.25+cooldown.dark_soul.remains
-			if BuffPresent(molten_core_buff) and target.TimeToDie() < { TimeInCombat() + target.TimeToDie() } * 0.25 + SpellCooldown(dark_soul_knowledge) Spell(soul_fire)
-		}
-	}
-}
-
 AddFunction DemonologyDefaultShortCdActions
 {
 	#mannoroths_fury
@@ -296,12 +227,14 @@ AddFunction DemonologyDefaultShortCdActions
 	#wrathguard:wrathstorm
 	if pet.Present() and pet.CreatureFamily(Wrathguard) Spell(wrathguard_wrathstorm)

-	unless not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and { ArmorSetBonus(T17 2) == 0 and { Charges(hand_of_guldan) == 1 and SpellChargeCooldown(hand_of_guldan) < 4 or Charges(hand_of_guldan) == 2 } or { Charges(hand_of_guldan) == 3 or Charges(hand_of_guldan) == 2 and SpellChargeCooldown(hand_of_guldan) < 13.8 - MaxTravelTime(hand_of_guldan) * 2 } and { SpellCooldown(cataclysm) > target.DebuffDuration(shadowflame_debuff) or not Talent(cataclysm_talent) } and SpellCooldown(dark_soul_knowledge) > target.DebuffDuration(shadowflame_debuff) or target.DebuffRemaining(shadowflame_debuff) > MaxTravelTime(hand_of_guldan) } and Spell(hand_of_guldan)
-		or not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and Talent(demonbolt_talent) and { ArmorSetBonus(T17 2) == 0 and { Charges(hand_of_guldan) == 1 and SpellChargeCooldown(hand_of_guldan) < 4 or Charges(hand_of_guldan) == 2 } or Charges(hand_of_guldan) == 3 or Charges(hand_of_guldan) == 2 and SpellChargeCooldown(hand_of_guldan) < 13.8 - MaxTravelTime(hand_of_guldan) * 2 or target.DebuffRemaining(shadowflame_debuff) > MaxTravelTime(hand_of_guldan) } and Spell(hand_of_guldan)
-		or not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(haunt) + 3 and BuffRemaining(demonbolt_buff) < GCD() * 2 and Charges(hand_of_guldan) >= 2 and Charges(dark_soul_knowledge) >= 1 and Spell(hand_of_guldan)
+	unless not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and { ArmorSetBonus(T17 4) == 0 and { Charges(hand_of_guldan) == 1 and SpellChargeCooldown(hand_of_guldan) < 4 or Charges(hand_of_guldan) == 2 } or { Charges(hand_of_guldan) == 3 or Charges(hand_of_guldan) == 2 and SpellChargeCooldown(hand_of_guldan) < 13.8 - MaxTravelTime(hand_of_guldan) * 2 } and { SpellCooldown(cataclysm) > target.DebuffDuration(shadowflame_debuff) or not Talent(cataclysm_talent) } and SpellCooldown(dark_soul_knowledge) > target.DebuffDuration(shadowflame_debuff) or target.DebuffRemaining(shadowflame_debuff) > MaxTravelTime(hand_of_guldan) } and Spell(hand_of_guldan) or not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and Talent(demonbolt_talent) and { ArmorSetBonus(T17 4) == 0 and { Charges(hand_of_guldan) == 1 and SpellChargeCooldown(hand_of_guldan) < 4 or Charges(hand_of_guldan) == 2 } or Charges(hand_of_guldan) == 3 or Charges(hand_of_guldan) == 2 and SpellChargeCooldown(hand_of_guldan) < 13.8 - MaxTravelTime(hand_of_guldan) * 2 or target.DebuffRemaining(shadowflame_debuff) > MaxTravelTime(hand_of_guldan) } and Spell(hand_of_guldan) or not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + 3 and BuffRemaining(demonbolt_buff) < GCD() * 2 and Charges(hand_of_guldan) >= 2 and Charges(dark_soul_knowledge) >= 1 and Spell(hand_of_guldan)
 	{
 		#service_pet,if=talent.grimoire_of_service.enabled
 		if Talent(grimoire_of_service_talent) Spell(grimoire_felguard)
+		#call_action_list,name=db,if=talent.demonbolt.enabled
+		if Talent(demonbolt_talent) DemonologyDbShortCdActions()
+		#kiljaedens_cunning,if=!cooldown.cataclysm.remains&buff.metamorphosis.up
+		if not SpellCooldown(cataclysm) > 0 and BuffPresent(metamorphosis_buff) Spell(kiljaedens_cunning)
 		#cataclysm,if=buff.metamorphosis.up
 		if BuffPresent(metamorphosis_buff) Spell(cataclysm)
 	}
@@ -324,11 +257,7 @@ AddFunction DemonologyDefaultCdActions
 	#imp_swarm,if=(buff.dark_soul.up|(cooldown.dark_soul.remains>(120%(1%spell_haste)))|time_to_die<32)&time>3
 	if { BuffPresent(dark_soul_knowledge_buff) or SpellCooldown(dark_soul_knowledge) > 120 / { 1 / { 100 / { 100 + SpellHaste() } } } or TimeToDie() < 32 } and TimeInCombat() > 3 Spell(imp_swarm)

-	unless not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and { ArmorSetBonus(T17 2) == 0 and { Charges(hand_of_guldan) == 1 and SpellChargeCooldown(hand_of_guldan) < 4 or Charges(hand_of_guldan) == 2 } or { Charges(hand_of_guldan) == 3 or Charges(hand_of_guldan) == 2 and SpellChargeCooldown(hand_of_guldan) < 13.8 - MaxTravelTime(hand_of_guldan) * 2 } and { SpellCooldown(cataclysm) > target.DebuffDuration(shadowflame_debuff) or not Talent(cataclysm_talent) } and SpellCooldown(dark_soul_knowledge) > target.DebuffDuration(shadowflame_debuff) or target.DebuffRemaining(shadowflame_debuff) > MaxTravelTime(hand_of_guldan) } and Spell(hand_of_guldan)
-		or not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and Talent(demonbolt_talent) and { ArmorSetBonus(T17 2) == 0 and { Charges(hand_of_guldan) == 1 and SpellChargeCooldown(hand_of_guldan) < 4 or Charges(hand_of_guldan) == 2 } or Charges(hand_of_guldan) == 3 or Charges(hand_of_guldan) == 2 and SpellChargeCooldown(hand_of_guldan) < 13.8 - MaxTravelTime(hand_of_guldan) * 2 or target.DebuffRemaining(shadowflame_debuff) > MaxTravelTime(hand_of_guldan) } and Spell(hand_of_guldan)
-		or not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(haunt) + 3 and BuffRemaining(demonbolt_buff) < GCD() * 2 and Charges(hand_of_guldan) >= 2 and Charges(dark_soul_knowledge) >= 1 and Spell(hand_of_guldan)
-		or Talent(grimoire_of_service_talent) and Spell(grimoire_felguard)
-		or DemonicFury() > 450 and Enemies() >= 3 and BuffExpires(immolation_aura_buff) and Spell(immolation_aura)
+	unless not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and { ArmorSetBonus(T17 4) == 0 and { Charges(hand_of_guldan) == 1 and SpellChargeCooldown(hand_of_guldan) < 4 or Charges(hand_of_guldan) == 2 } or { Charges(hand_of_guldan) == 3 or Charges(hand_of_guldan) == 2 and SpellChargeCooldown(hand_of_guldan) < 13.8 - MaxTravelTime(hand_of_guldan) * 2 } and { SpellCooldown(cataclysm) > target.DebuffDuration(shadowflame_debuff) or not Talent(cataclysm_talent) } and SpellCooldown(dark_soul_knowledge) > target.DebuffDuration(shadowflame_debuff) or target.DebuffRemaining(shadowflame_debuff) > MaxTravelTime(hand_of_guldan) } and Spell(hand_of_guldan) or not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + CastTime(shadow_bolt) and Talent(demonbolt_talent) and { ArmorSetBonus(T17 4) == 0 and { Charges(hand_of_guldan) == 1 and SpellChargeCooldown(hand_of_guldan) < 4 or Charges(hand_of_guldan) == 2 } or Charges(hand_of_guldan) == 3 or Charges(hand_of_guldan) == 2 and SpellChargeCooldown(hand_of_guldan) < 13.8 - MaxTravelTime(hand_of_guldan) * 2 or target.DebuffRemaining(shadowflame_debuff) > MaxTravelTime(hand_of_guldan) } and Spell(hand_of_guldan) or not InFlightToTarget(hand_of_guldan) and target.DebuffRemaining(shadowflame_debuff) < MaxTravelTime(hand_of_guldan) + 3 and BuffRemaining(demonbolt_buff) < GCD() * 2 and Charges(hand_of_guldan) >= 2 and Charges(dark_soul_knowledge) >= 1 and Spell(hand_of_guldan) or Talent(grimoire_of_service_talent) and Spell(grimoire_felguard)
 	{
 		#summon_doomguard,if=!talent.demonic_servitude.enabled&active_enemies<5
 		if not Talent(demonic_servitude_talent) and Enemies() < 5 Spell(summon_doomguard)
@@ -337,9 +266,9 @@ AddFunction DemonologyDefaultCdActions
 	}
 }

-# ActionList: DemonologyDbActions --> main, predict
+### actions.db

-AddFunction DemonologyDbActions
+AddFunction DemonologyDbMainActions
 {
 	#immolation_aura,if=demonic_fury>450&active_enemies>=5&buff.immolation_aura.down
 	if DemonicFury() > 450 and Enemies() >= 5 and BuffExpires(immolation_aura_buff) Spell(immolation_aura)
@@ -356,9 +285,9 @@ AddFunction DemonologyDbActions
 	#chaos_wave,if=buff.metamorphosis.up&buff.dark_soul.up&active_enemies>=3&demonic_fury>450
 	if BuffPresent(metamorphosis_buff) and BuffPresent(dark_soul_knowledge_buff) and Enemies() >= 3 and DemonicFury() > 450 Spell(chaos_wave)
 	#soul_fire,if=buff.metamorphosis.up&buff.molten_core.react&(((buff.dark_soul.remains>execute_time)&demonic_fury>=175)|(target.time_to_die<buff.demonbolt.remains))
-	if BuffPresent(metamorphosis_buff) and BuffPresent(molten_core_buff) and { BuffRemaining(dark_soul_knowledge_buff) > ExecuteTime(soul_fire) and DemonicFury() >= 175 or target.TimeToDie() < BuffRemaining(demonbolt_buff) } Spell(soul_fire)
+	if BuffPresent(metamorphosis_buff) and BuffPresent(molten_core_buff any=1) and { BuffRemaining(dark_soul_knowledge_buff) > ExecuteTime(soul_fire) and DemonicFury() >= 175 or target.TimeToDie() < BuffRemaining(demonbolt_buff) } Spell(soul_fire)
 	#soul_fire,if=buff.metamorphosis.up&buff.molten_core.react&target.health.pct<=25&(((demonic_fury-80)%800)>(buff.demonbolt.remains%(40*spell_haste)))&demonic_fury>=750
-	if BuffPresent(metamorphosis_buff) and BuffPresent(molten_core_buff) and target.HealthPercent() <= 25 and { DemonicFury() - 80 } / 800 > BuffRemaining(demonbolt_buff) / { 40 * 100 / { 100 + SpellHaste() } } and DemonicFury() >= 750 Spell(soul_fire)
+	if BuffPresent(metamorphosis_buff) and BuffPresent(molten_core_buff any=1) and target.HealthPercent() <= 25 and { DemonicFury() - 80 } / 800 > BuffRemaining(demonbolt_buff) / { 40 * 100 / { 100 + SpellHaste() } } and DemonicFury() >= 750 Spell(soul_fire)
 	#touch_of_chaos,cycle_targets=1,if=buff.metamorphosis.up&dot.corruption.remains<17.4&demonic_fury>750
 	if BuffPresent(metamorphosis_buff) and target.DebuffRemaining(corruption_debuff) < 17.4 and DemonicFury() > 750 Spell(touch_of_chaos)
 	#touch_of_chaos,if=buff.metamorphosis.up&(target.time_to_die<buff.demonbolt.remains|demonic_fury>=750&buff.demonbolt.remains)
@@ -382,7 +311,7 @@ AddFunction DemonologyDbActions
 	#hellfire,interrupt=1,if=active_enemies>=5
 	if Enemies() >= 5 Spell(hellfire)
 	#soul_fire,if=buff.molten_core.react&(buff.dark_soul.remains<action.shadow_bolt.cast_time|buff.dark_soul.remains>cast_time)
-	if BuffPresent(molten_core_buff) and { BuffRemaining(dark_soul_knowledge_buff) < CastTime(shadow_bolt) or BuffRemaining(dark_soul_knowledge_buff) > CastTime(soul_fire) } Spell(soul_fire)
+	if BuffPresent(molten_core_buff any=1) and { BuffRemaining(dark_soul_knowledge_buff) < CastTime(shadow_bolt) or BuffRemaining(dark_soul_knowledge_buff) > CastTime(soul_fire) } Spell(soul_fire)
 	#life_tap,if=mana.pct<40
 	if ManaPercent() < 40 Spell(life_tap)
 	#hellfire,interrupt=1,if=active_enemies>=4
@@ -395,68 +324,23 @@ AddFunction DemonologyDbActions
 	Spell(life_tap)
 }

-AddFunction DemonologyDbPredictActions
+AddFunction DemonologyDbShortCdActions
 {
-	#immolation_aura,if=demonic_fury>450&active_enemies>=5&buff.immolation_aura.down
-	if DemonicFury() > 450 and Enemies() >= 5 and BuffExpires(immolation_aura_buff) Spell(immolation_aura)
-	#doom,cycle_targets=1,if=buff.metamorphosis.up&active_enemies>=6&target.time_to_die>=30*spell_haste&remains<=(duration*0.3)&(buff.dark_soul.down|!glyph.dark_soul.enabled)
-	if BuffPresent(metamorphosis_buff) and Enemies() >= 6 and target.TimeToDie() >= 30 * 100 / { 100 + SpellHaste() } and target.DebuffRemaining(doom_debuff) <= BaseDuration(doom_debuff) * 0.3 and { BuffExpires(dark_soul_knowledge_buff) or not Glyph(glyph_of_dark_soul) } Spell(doom)
-	#demonbolt,if=buff.demonbolt.stack=0|(buff.demonbolt.stack<4&buff.demonbolt.remains>=(40*spell_haste-execute_time))
-	if BuffStacks(demonbolt_buff) == 0 or BuffStacks(demonbolt_buff) < 4 and BuffRemaining(demonbolt_buff) >= 40 * 100 / { 100 + SpellHaste() } - ExecuteTime(demonbolt) Spell(demonbolt)
-	#doom,cycle_targets=1,if=buff.metamorphosis.up&target.time_to_die>=30*spell_haste&remains<=(duration*0.3)&(buff.dark_soul.down|!glyph.dark_soul.enabled)
-	if BuffPresent(metamorphosis_buff) and target.TimeToDie() >= 30 * 100 / { 100 + SpellHaste() } and target.DebuffRemaining(doom_debuff) <= BaseDuration(doom_debuff) * 0.3 and { BuffExpires(dark_soul_knowledge_buff) or not Glyph(glyph_of_dark_soul) } Spell(doom)
-	#corruption,cycle_targets=1,if=target.time_to_die>=6&remains<=(0.3*duration)&buff.metamorphosis.down
-	if target.TimeToDie() >= 6 and target.DebuffRemaining(corruption_debuff) <= 0.3 * BaseDuration(corruption_debuff) and BuffExpires(metamorphosis_buff) Spell(corruption)
-	#cancel_metamorphosis,if=buff.metamorphosis.up&buff.demonbolt.stack>3&demonic_fury<=600&target.time_to_die>buff.demonbolt.remains&buff.dark_soul.down
-	if BuffPresent(metamorphosis_buff) and BuffStacks(demonbolt_buff) > 3 and DemonicFury() <= 600 and target.TimeToDie() > BuffRemaining(demonbolt_buff) and BuffExpires(dark_soul_knowledge_buff) and BuffPresent(metamorphosis_buff) Spell(metamorphosis text=cancel)
-	#chaos_wave,if=buff.metamorphosis.up&buff.dark_soul.up&active_enemies>=3&demonic_fury>450
-	if BuffPresent(metamorphosis_buff) and BuffPresent(dark_soul_knowledge_buff) and Enemies() >= 3 and DemonicFury() > 450 Spell(chaos_wave)
-	#soul_fire,if=buff.metamorphosis.up&buff.molten_core.react&(((buff.dark_soul.remains>execute_time)&demonic_fury>=175)|(target.time_to_die<buff.demonbolt.remains))
-	if BuffPresent(metamorphosis_buff) and BuffPresent(molten_core_buff) and { BuffRemaining(dark_soul_knowledge_buff) > ExecuteTime(soul_fire) and DemonicFury() >= 175 or target.TimeToDie() < BuffRemaining(demonbolt_buff) } Spell(soul_fire)
-	#soul_fire,if=buff.metamorphosis.up&buff.molten_core.react&target.health.pct<=25&(((demonic_fury-80)%800)>(buff.demonbolt.remains%(40*spell_haste)))&demonic_fury>=750
-	if BuffPresent(metamorphosis_buff) and BuffPresent(molten_core_buff) and target.HealthPercent() <= 25 and { DemonicFury() - 80 } / 800 > BuffRemaining(demonbolt_buff) / { 40 * 100 / { 100 + SpellHaste() } } and DemonicFury() >= 750 Spell(soul_fire)
-
-	unless BuffPresent(metamorphosis_buff) and target.DebuffRemaining(corruption_debuff) < 17.4 and DemonicFury() > 750 and Spell(touch_of_chaos)
-		or BuffPresent(metamorphosis_buff) and { target.TimeToDie() < BuffRemaining(demonbolt_buff) or DemonicFury() >= 750 and BuffPresent(demonbolt_buff) } and Spell(touch_of_chaos)
-		or BuffPresent(metamorphosis_buff) and { DemonicFury() - 40 } / 800 > BuffRemaining(demonbolt_buff) / { 40 * 100 / { 100 + SpellHaste() } } and DemonicFury() >= 750 and Spell(touch_of_chaos)
+	unless DemonicFury() > 450 and Enemies() >= 5 and BuffExpires(immolation_aura_buff) and Spell(immolation_aura) or BuffPresent(metamorphosis_buff) and Enemies() >= 6 and target.TimeToDie() >= 30 * 100 / { 100 + SpellHaste() } and target.DebuffRemaining(doom_debuff) <= BaseDuration(doom_debuff) * 0.3 and { BuffExpires(dark_soul_knowledge_buff) or not Glyph(glyph_of_dark_soul) } and Spell(doom)
 	{
-		#metamorphosis,if=buff.dark_soul.remains>gcd&demonic_fury>=240&(buff.demonbolt.down|target.time_to_die<buff.demonbolt.remains|(buff.dark_soul.remains>execute_time&demonic_fury>=175))
-		if BuffRemaining(dark_soul_knowledge_buff) > GCD() and DemonicFury() >= 240 and { BuffExpires(demonbolt_buff) or target.TimeToDie() < BuffRemaining(demonbolt_buff) or BuffRemaining(dark_soul_knowledge_buff) > ExecuteTime(metamorphosis) and DemonicFury() >= 175 } Spell(metamorphosis)
-		#metamorphosis,if=buff.demonbolt.down&demonic_fury>=480&(action.dark_soul.charges=0|!talent.archimondes_darkness.enabled&cooldown.dark_soul.remains)
-		if BuffExpires(demonbolt_buff) and DemonicFury() >= 480 and { Charges(dark_soul_knowledge) == 0 or not Talent(archimondes_darkness_talent) and SpellCooldown(dark_soul_knowledge) > 0 } Spell(metamorphosis)
-		#metamorphosis,if=(demonic_fury%80)*2*spell_haste>=target.time_to_die&target.time_to_die<buff.demonbolt.remains
-		if DemonicFury() / 80 * 2 * 100 / { 100 + SpellHaste() } >= target.TimeToDie() and target.TimeToDie() < BuffRemaining(demonbolt_buff) Spell(metamorphosis)
-		#metamorphosis,if=target.time_to_die>=30*spell_haste&!dot.doom.ticking&buff.dark_soul.down
-		if target.TimeToDie() >= 30 * 100 / { 100 + SpellHaste() } and not target.DebuffPresent(doom_debuff) and BuffExpires(dark_soul_knowledge_buff) Spell(metamorphosis)
-		#metamorphosis,if=demonic_fury>750&buff.demonbolt.remains>=action.metamorphosis.cooldown
-		if DemonicFury() > 750 and BuffRemaining(demonbolt_buff) >= SpellCooldown(metamorphosis) Spell(metamorphosis)
-		#metamorphosis,if=(((demonic_fury-120)%800)>(buff.demonbolt.remains%(40*spell_haste)))&buff.demonbolt.remains>=10&dot.doom.remains<=dot.doom.duration*0.3
-		if { DemonicFury() - 120 } / 800 > BuffRemaining(demonbolt_buff) / { 40 * 100 / { 100 + SpellHaste() } } and BuffRemaining(demonbolt_buff) >= 10 and target.DebuffRemaining(doom_debuff) <= target.DebuffDuration(doom_debuff) * 0.3 Spell(metamorphosis)
-		#cancel_metamorphosis
-		if BuffPresent(metamorphosis_buff) Spell(metamorphosis text=cancel)
-
-		unless Enemies() >= 5 and Spell(hellfire)
-		{
-			#soul_fire,if=buff.molten_core.react&(buff.dark_soul.remains<action.shadow_bolt.cast_time|buff.dark_soul.remains>cast_time)
-			if BuffPresent(molten_core_buff) and { BuffRemaining(dark_soul_knowledge_buff) < CastTime(shadow_bolt) or BuffRemaining(dark_soul_knowledge_buff) > CastTime(soul_fire) } Spell(soul_fire)
-		}
+		#kiljaedens_cunning,moving=1,if=buff.demonbolt.stack=0|(buff.demonbolt.stack<4&buff.demonbolt.remains>=(40*spell_haste-execute_time))
+		if Speed() > 0 and { BuffStacks(demonbolt_buff) == 0 or BuffStacks(demonbolt_buff) < 4 and BuffRemaining(demonbolt_buff) >= 40 * 100 / { 100 + SpellHaste() } - ExecuteTime(kiljaedens_cunning) } Spell(kiljaedens_cunning)
 	}
 }

-# ActionList: DemonologyPrecombatActions --> main, predict, shortcd, cd
-
-AddFunction DemonologyPrecombatActions
-{
-	DemonologyPrecombatPredictActions()
-}
+### actions.precombat

-AddFunction DemonologyPrecombatPredictActions
+AddFunction DemonologyPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=sleeper_surprise
 	#dark_intent,if=!aura.spell_power_multiplier.up
 	if not BuffPresent(spell_power_multiplier_buff any=1) Spell(dark_intent)
-	#snapshot_stats
 	#soul_fire
 	Spell(soul_fire)
 }
@@ -467,6 +351,7 @@ AddFunction DemonologyPrecombatShortCdActions
 	{
 		#summon_pet,if=!talent.demonic_servitude.enabled&(!talent.grimoire_of_sacrifice.enabled|buff.grimoire_of_sacrifice.down)
 		if not Talent(demonic_servitude_talent) and { not Talent(grimoire_of_sacrifice_talent) or BuffExpires(grimoire_of_sacrifice_buff) } and not pet.Present() Spell(summon_felguard)
+		#snapshot_stats
 		#service_pet,if=talent.grimoire_of_service.enabled
 		if Talent(grimoire_of_service_talent) Spell(grimoire_felguard)
 	}
@@ -474,8 +359,7 @@ AddFunction DemonologyPrecombatShortCdActions

 AddFunction DemonologyPrecombatCdActions
 {
-	unless not BuffPresent(spell_power_multiplier_buff any=1) and Spell(dark_intent)
-		or not Talent(demonic_servitude_talent) and { not Talent(grimoire_of_sacrifice_talent) or BuffExpires(grimoire_of_sacrifice_buff) } and not pet.Present() and Spell(summon_felguard)
+	unless not BuffPresent(spell_power_multiplier_buff any=1) and Spell(dark_intent) or not Talent(demonic_servitude_talent) and { not Talent(grimoire_of_sacrifice_talent) or BuffExpires(grimoire_of_sacrifice_buff) } and not pet.Present() and Spell(summon_felguard)
 	{
 		#summon_doomguard,if=talent.demonic_servitude.enabled&active_enemies<5
 		if Talent(demonic_servitude_talent) and Enemies() < 5 Spell(summon_doomguard)
@@ -499,30 +383,22 @@ AddFunction DemonologyPrecombatCdActions
 #	talents=0000113
 #	pet=felhunter

-# ActionList: DestructionDefaultActions --> main, predict, shortcd, cd
-
-AddFunction DestructionDefaultActions
-{
-	#run_action_list,name=single_target,if=active_enemies<6
-	if Enemies() < 6 DestructionSingleTargetActions()
-	#run_action_list,name=aoe,if=active_enemies>=6
-	if Enemies() >= 6 DestructionAoeActions()
-}
+### actions.default

-AddFunction DestructionDefaultPredictActions
+AddFunction DestructionDefaultMainActions
 {
 	#run_action_list,name=single_target,if=active_enemies<6
-	if Enemies() < 6 DestructionSingleTargetPredictActions()
+	if Enemies() < 6 DestructionSingleTargetMainActions()
 	#run_action_list,name=aoe,if=active_enemies>=6
-	if Enemies() >= 6 DestructionAoePredictActions()
+	if Enemies() >= 6 DestructionAoeMainActions()
 }

 AddFunction DestructionDefaultShortCdActions
 {
 	#mannoroths_fury
 	Spell(mannoroths_fury)
-	#service_pet,if=talent.grimoire_of_service.enabled&!talent.demonbolt.enabled
-	if Talent(grimoire_of_service_talent) and not Talent(demonbolt_talent) Spell(grimoire_felhunter)
+	#service_pet,if=talent.grimoire_of_service.enabled
+	if Talent(grimoire_of_service_talent) Spell(grimoire_felhunter)
 	#run_action_list,name=single_target,if=active_enemies<6
 	if Enemies() < 6 DestructionSingleTargetShortCdActions()
 	#run_action_list,name=aoe,if=active_enemies>=6
@@ -542,30 +418,18 @@ AddFunction DestructionDefaultCdActions
 	#dark_soul,if=!talent.archimondes_darkness.enabled|(talent.archimondes_darkness.enabled&(charges=2|trinket.proc.intellect.react|trinket.stacking_proc.intellect.react>6|target.health.pct<=10))
 	if not Talent(archimondes_darkness_talent) or Talent(archimondes_darkness_talent) and { Charges(dark_soul_instability) == 2 or BuffPresent(trinket_proc_intellect_buff) or BuffStacks(trinket_stacking_proc_intellect_buff) > 6 or target.HealthPercent() <= 10 } Spell(dark_soul_instability)

-	unless Talent(grimoire_of_service_talent) and not Talent(demonbolt_talent) and Spell(grimoire_felhunter)
+	unless Talent(grimoire_of_service_talent) and Spell(grimoire_felhunter)
 	{
 		#summon_doomguard,if=!talent.demonic_servitude.enabled&active_enemies<5
 		if not Talent(demonic_servitude_talent) and Enemies() < 5 Spell(summon_doomguard)
 		#summon_infernal,if=!talent.demonic_servitude.enabled&active_enemies>=5
 		if not Talent(demonic_servitude_talent) and Enemies() >= 5 Spell(summon_infernal)
-		#run_action_list,name=single_target,if=active_enemies<6
-		if Enemies() < 6 DestructionSingleTargetCdActions()
-		#run_action_list,name=aoe,if=active_enemies>=6
-		if Enemies() >= 6 DestructionAoeCdActions()
 	}
 }

-# ActionList: DestructionAoeActions --> main, predict, shortcd, cd
-
-AddFunction DestructionAoeActions
-{
-	DestructionAoePredictActions()
-
-	#incinerate
-	Spell(incinerate)
-}
+### actions.aoe

-AddFunction DestructionAoePredictActions
+AddFunction DestructionAoeMainActions
 {
 	#rain_of_fire,if=remains<=tick_time
 	if target.DebuffRemaining(rain_of_fire_debuff) <= target.TickTime(rain_of_fire_debuff) Spell(rain_of_fire)
@@ -573,8 +437,6 @@ AddFunction DestructionAoePredictActions
 	if BuffPresent(havoc_buff) Spell(shadowburn)
 	#chaos_bolt,if=buff.havoc.remains>cast_time&buff.havoc.stack>=3
 	if BuffRemaining(havoc_buff) > CastTime(chaos_bolt) and BuffStacks(havoc_buff) >= 3 Spell(chaos_bolt)
-	#fire_and_brimstone,if=buff.fire_and_brimstone.down
-	if BuffExpires(fire_and_brimstone_buff) Spell(fire_and_brimstone)
 	#immolate,if=buff.fire_and_brimstone.up&!dot.immolate.ticking
 	if BuffPresent(fire_and_brimstone_buff) and not target.DebuffPresent(immolate_debuff) Spell(immolate)
 	#conflagrate,if=buff.fire_and_brimstone.up&charges=2
@@ -583,6 +445,8 @@ AddFunction DestructionAoePredictActions
 	if BuffPresent(fire_and_brimstone_buff) and target.DebuffRemaining(immolate_debuff) <= target.DebuffDuration(immolate_debuff) * 0.3 Spell(immolate)
 	#chaos_bolt,if=talent.charred_remains.enabled&buff.fire_and_brimstone.up&burning_ember>=2.5
 	if Talent(charred_remains_talent) and BuffPresent(fire_and_brimstone_buff) and BurningEmbers() / 10 >= 2.5 Spell(chaos_bolt)
+	#incinerate
+	Spell(incinerate)
 }

 AddFunction DestructionAoeShortCdActions
@@ -592,28 +456,23 @@ AddFunction DestructionAoeShortCdActions
 		#havoc,target=2
 		if Enemies() > 1 Spell(havoc text=other)

-		unless BuffPresent(havoc_buff) and Spell(shadowburn)
-			or BuffRemaining(havoc_buff) > CastTime(chaos_bolt) and BuffStacks(havoc_buff) >= 3 and Spell(chaos_bolt)
+		unless BuffPresent(havoc_buff) and Spell(shadowburn) or BuffRemaining(havoc_buff) > CastTime(chaos_bolt) and BuffStacks(havoc_buff) >= 3 and Spell(chaos_bolt)
 		{
+			#kiljaedens_cunning,if=(talent.cataclysm.enabled&!cooldown.cataclysm.remains)
+			if Talent(cataclysm_talent) and not SpellCooldown(cataclysm) > 0 Spell(kiljaedens_cunning)
+			#kiljaedens_cunning,moving=1,if=!talent.cataclysm.enabled
+			if Speed() > 0 and not Talent(cataclysm_talent) Spell(kiljaedens_cunning)
 			#cataclysm
 			Spell(cataclysm)
+			#fire_and_brimstone,if=buff.fire_and_brimstone.down
+			if BuffExpires(fire_and_brimstone_buff) Spell(fire_and_brimstone)
 		}
 	}
 }

-AddFunction DestructionAoeCdActions {}
-
-# ActionList: DestructionPrecombatActions --> main, predict, shortcd, cd
-
-AddFunction DestructionPrecombatActions
-{
-	DestructionPrecombatPredictActions()
-
-	#incinerate
-	Spell(incinerate)
-}
+### actions.precombat

-AddFunction DestructionPrecombatPredictActions
+AddFunction DestructionPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=blackrock_barbecue
@@ -622,6 +481,8 @@ AddFunction DestructionPrecombatPredictActions
 	#snapshot_stats
 	#grimoire_of_sacrifice,if=talent.grimoire_of_sacrifice.enabled&!talent.demonic_servitude.enabled
 	if Talent(grimoire_of_sacrifice_talent) and not Talent(demonic_servitude_talent) and pet.Present() Spell(grimoire_of_sacrifice)
+	#incinerate
+	Spell(incinerate)
 }

 AddFunction DestructionPrecombatShortCdActions
@@ -637,8 +498,7 @@ AddFunction DestructionPrecombatShortCdActions

 AddFunction DestructionPrecombatCdActions
 {
-	unless not BuffPresent(spell_power_multiplier_buff any=1) and Spell(dark_intent)
-		or not Talent(demonic_servitude_talent) and { not Talent(grimoire_of_sacrifice_talent) or BuffExpires(grimoire_of_sacrifice_buff) } and not pet.Present() and Spell(summon_felhunter)
+	unless not BuffPresent(spell_power_multiplier_buff any=1) and Spell(dark_intent) or not Talent(demonic_servitude_talent) and { not Talent(grimoire_of_sacrifice_talent) or BuffExpires(grimoire_of_sacrifice_buff) } and not pet.Present() and Spell(summon_felhunter)
 	{
 		#summon_doomguard,if=talent.demonic_servitude.enabled&active_enemies<5
 		if Talent(demonic_servitude_talent) and Enemies() < 5 Spell(summon_doomguard)
@@ -653,26 +513,14 @@ AddFunction DestructionPrecombatCdActions
 	}
 }

-# ActionList: DestructionSingleTargetActions --> main, predict, shortcd, cd
-
-AddFunction DestructionSingleTargetActions
-{
-	DestructionSingleTargetPredictActions()
-
-	#incinerate
-	Spell(incinerate)
-}
+### actions.single_target

-AddFunction DestructionSingleTargetPredictActions
+AddFunction DestructionSingleTargetMainActions
 {
 	#shadowburn,if=talent.charred_remains.enabled&(burning_ember>=2.5|buff.dark_soul.up|target.time_to_die<10)
 	if Talent(charred_remains_talent) and { BurningEmbers() / 10 >= 2.5 or BuffPresent(dark_soul_instability_buff) or target.TimeToDie() < 10 } Spell(shadowburn)
-	#fire_and_brimstone,if=buff.fire_and_brimstone.down&dot.immolate.remains<=action.immolate.cast_time&(cooldown.cataclysm.remains>action.immolate.cast_time|!talent.cataclysm.enabled)&active_enemies>4
-	if BuffExpires(fire_and_brimstone_buff) and target.DebuffRemaining(immolate_debuff) <= CastTime(immolate) and { SpellCooldown(cataclysm) > CastTime(immolate) or not Talent(cataclysm_talent) } and Enemies() > 4 Spell(fire_and_brimstone)
 	#immolate,cycle_targets=1,if=remains<=cast_time&(cooldown.cataclysm.remains>cast_time|!talent.cataclysm.enabled)
 	if target.DebuffRemaining(immolate_debuff) <= CastTime(immolate) and { SpellCooldown(cataclysm) > CastTime(immolate) or not Talent(cataclysm_talent) } Spell(immolate)
-	#cancel_buff,name=fire_and_brimstone,if=buff.fire_and_brimstone.up&dot.immolate.remains>(dot.immolate.duration*0.3)
-	if BuffPresent(fire_and_brimstone_buff) and target.DebuffRemaining(immolate_debuff) > target.DebuffDuration(immolate_debuff) * 0.3 and BuffPresent(fire_and_brimstone_buff) Texture(fire_and_brimstone text=cancel)
 	#shadowburn,if=buff.havoc.remains
 	if BuffPresent(havoc_buff) Spell(shadowburn)
 	#chaos_bolt,if=buff.havoc.remains>cast_time&buff.havoc.stack>=3
@@ -705,12 +553,12 @@ AddFunction DestructionSingleTargetPredictActions
 	if BuffStacks(backdraft_buff) < 3 and BuffPresent(trinket_proc_versatility_buff) and BuffRemaining(trinket_proc_versatility_buff) > CastTime(chaos_bolt) Spell(chaos_bolt)
 	#chaos_bolt,if=buff.backdraft.stack<3&trinket.proc.mastery.react&trinket.proc.mastery.remains>cast_time
 	if BuffStacks(backdraft_buff) < 3 and BuffPresent(trinket_proc_mastery_buff) and BuffRemaining(trinket_proc_mastery_buff) > CastTime(chaos_bolt) Spell(chaos_bolt)
-	#fire_and_brimstone,if=buff.fire_and_brimstone.down&dot.immolate.remains<=(dot.immolate.duration*0.3)&active_enemies>4
-	if BuffExpires(fire_and_brimstone_buff) and target.DebuffRemaining(immolate_debuff) <= target.DebuffDuration(immolate_debuff) * 0.3 and Enemies() > 4 Spell(fire_and_brimstone)
 	#immolate,cycle_targets=1,if=remains<=(duration*0.3)
 	if target.DebuffRemaining(immolate_debuff) <= BaseDuration(immolate_debuff) * 0.3 Spell(immolate)
 	#conflagrate
 	Spell(conflagrate)
+	#incinerate
+	Spell(incinerate)
 }

 AddFunction DestructionSingleTargetShortCdActions
@@ -720,21 +568,28 @@ AddFunction DestructionSingleTargetShortCdActions

 	unless Talent(charred_remains_talent) and { BurningEmbers() / 10 >= 2.5 or BuffPresent(dark_soul_instability_buff) or target.TimeToDie() < 10 } and Spell(shadowburn)
 	{
+		#kiljaedens_cunning,if=(talent.cataclysm.enabled&!cooldown.cataclysm.remains)
+		if Talent(cataclysm_talent) and not SpellCooldown(cataclysm) > 0 Spell(kiljaedens_cunning)
+		#kiljaedens_cunning,moving=1,if=!talent.cataclysm.enabled
+		if Speed() > 0 and not Talent(cataclysm_talent) Spell(kiljaedens_cunning)
 		#cataclysm,if=active_enemies>1
 		if Enemies() > 1 Spell(cataclysm)
+		#fire_and_brimstone,if=buff.fire_and_brimstone.down&dot.immolate.remains<=action.immolate.cast_time&(cooldown.cataclysm.remains>action.immolate.cast_time|!talent.cataclysm.enabled)&active_enemies>4
+		if BuffExpires(fire_and_brimstone_buff) and target.DebuffRemaining(immolate_debuff) <= CastTime(immolate) and { SpellCooldown(cataclysm) > CastTime(immolate) or not Talent(cataclysm_talent) } and Enemies() > 4 Spell(fire_and_brimstone)

-		unless target.DebuffRemaining(immolate_debuff) <= CastTime(immolate) and { SpellCooldown(cataclysm) > CastTime(immolate) or not Talent(cataclysm_talent) } and Spell(immolate)
-			or BuffPresent(havoc_buff) and Spell(shadowburn)
-			or BuffRemaining(havoc_buff) > CastTime(chaos_bolt) and BuffStacks(havoc_buff) >= 3 and Spell(chaos_bolt)
-			or Charges(conflagrate) == 2 and Spell(conflagrate)
+		unless target.DebuffRemaining(immolate_debuff) <= CastTime(immolate) and { SpellCooldown(cataclysm) > CastTime(immolate) or not Talent(cataclysm_talent) } and Spell(immolate) or BuffPresent(havoc_buff) and Spell(shadowburn) or BuffRemaining(havoc_buff) > CastTime(chaos_bolt) and BuffStacks(havoc_buff) >= 3 and Spell(chaos_bolt) or Charges(conflagrate) == 2 and Spell(conflagrate)
 		{
 			#cataclysm
 			Spell(cataclysm)
+
+			unless target.DebuffRemaining(rain_of_fire_debuff) <= target.TickTime(rain_of_fire_debuff) and { Enemies() > 4 or BuffPresent(mannoroths_fury_buff) and Enemies() > 2 } and Spell(rain_of_fire) or Talent(charred_remains_talent) and Enemies() > 1 and target.HealthPercent() > 20 and Spell(chaos_bolt) or Talent(charred_remains_talent) and BuffStacks(backdraft_buff) < 3 and BurningEmbers() / 10 >= 2.5 and Spell(chaos_bolt) or BuffStacks(backdraft_buff) < 3 and { BurningEmbers() / 10 >= 3.5 or BuffPresent(dark_soul_instability_buff) or BurningEmbers() / 10 >= 3 and BuffPresent(ember_master_buff) or target.TimeToDie() < 20 } and Spell(chaos_bolt) or BuffStacks(backdraft_buff) < 3 and ArmorSetBonus(T17 2) == 1 and BurningEmbers() / 10 >= 2.5 and Spell(chaos_bolt) or BuffStacks(backdraft_buff) < 3 and BuffPresent(archmages_greater_incandescence_int_buff) and BuffRemaining(archmages_greater_incandescence_int_buff) > CastTime(chaos_bolt) and Spell(chaos_bolt) or BuffStacks(backdraft_buff) < 3 and BuffPresent(trinket_proc_intellect_buff) and BuffRemaining(trinket_proc_intellect_buff) > CastTime(chaos_bolt) and Spell(chaos_bolt) or BuffStacks(backdraft_buff) < 3 and BuffStacks(trinket_stacking_proc_intellect_buff) > 7 and BuffRemaining(trinket_stacking_proc_intellect_buff) >= CastTime(chaos_bolt) and Spell(chaos_bolt) or BuffStacks(backdraft_buff) < 3 and BuffPresent(trinket_proc_crit_buff) and BuffRemaining(trinket_proc_crit_buff) > CastTime(chaos_bolt) and Spell(chaos_bolt) or BuffStacks(backdraft_buff) < 3 and BuffStacks(trinket_stacking_proc_multistrike_buff) >= 8 and BuffRemaining(trinket_stacking_proc_multistrike_buff) >= CastTime(chaos_bolt) and Spell(chaos_bolt) or BuffStacks(backdraft_buff) < 3 and BuffPresent(trinket_proc_multistrike_buff) and BuffRemaining(trinket_proc_multistrike_buff) > CastTime(chaos_bolt) and Spell(chaos_bolt) or BuffStacks(backdraft_buff) < 3 and BuffPresent(trinket_proc_versatility_buff) and BuffRemaining(trinket_proc_versatility_buff) > CastTime(chaos_bolt) and Spell(chaos_bolt) or BuffStacks(backdraft_buff) < 3 and BuffPresent(trinket_proc_mastery_buff) and BuffRemaining(trinket_proc_mastery_buff) > CastTime(chaos_bolt) and Spell(chaos_bolt)
+			{
+				#fire_and_brimstone,if=buff.fire_and_brimstone.down&dot.immolate.remains<=(dot.immolate.duration*0.3)&active_enemies>4
+				if BuffExpires(fire_and_brimstone_buff) and target.DebuffRemaining(immolate_debuff) <= target.DebuffDuration(immolate_debuff) * 0.3 and Enemies() > 4 Spell(fire_and_brimstone)
+			}
 		}
 	}
 }
-
-AddFunction DestructionSingleTargetCdActions {}
 ]]
 	OvaleScripts:RegisterScript("WARLOCK", name, desc, code, "include")
 end
@@ -753,43 +608,37 @@ AddCheckBox(opt_warlock_affliction_aoe L(AOE) specialization=affliction default)

 AddIcon specialization=affliction help=shortcd enemies=1 checkbox=!opt_warlock_affliction_aoe
 {
-	if InCombat(no) AfflictionPrecombatShortCdActions()
+	if not InCombat() AfflictionPrecombatShortCdActions()
 	AfflictionDefaultShortCdActions()
 }

 AddIcon specialization=affliction help=shortcd checkbox=opt_warlock_affliction_aoe
 {
-	if InCombat(no) AfflictionPrecombatShortCdActions()
+	if not InCombat() AfflictionPrecombatShortCdActions()
 	AfflictionDefaultShortCdActions()
 }

 AddIcon specialization=affliction help=main enemies=1
 {
-	if InCombat(no) AfflictionPrecombatActions()
-	AfflictionDefaultActions()
-}
-
-AddIcon specialization=affliction help=predict enemies=1 checkbox=!opt_warlock_affliction_aoe
-{
-	if InCombat(no) AfflictionPrecombatPredictActions()
-	AfflictionDefaultPredictActions()
+	if not InCombat() AfflictionPrecombatMainActions()
+	AfflictionDefaultMainActions()
 }

 AddIcon specialization=affliction help=aoe checkbox=opt_warlock_affliction_aoe
 {
-	if InCombat(no) AfflictionPrecombatActions()
-	AfflictionDefaultActions()
+	if not InCombat() AfflictionPrecombatMainActions()
+	AfflictionDefaultMainActions()
 }

 AddIcon specialization=affliction help=cd enemies=1 checkbox=!opt_warlock_affliction_aoe
 {
-	if InCombat(no) AfflictionPrecombatCdActions()
+	if not InCombat() AfflictionPrecombatCdActions()
 	AfflictionDefaultCdActions()
 }

 AddIcon specialization=affliction help=cd checkbox=opt_warlock_affliction_aoe
 {
-	if InCombat(no) AfflictionPrecombatCdActions()
+	if not InCombat() AfflictionPrecombatCdActions()
 	AfflictionDefaultCdActions()
 }

@@ -798,43 +647,37 @@ AddCheckBox(opt_warlock_demonology_aoe L(AOE) specialization=demonology default)

 AddIcon specialization=demonology help=shortcd enemies=1 checkbox=!opt_warlock_demonology_aoe
 {
-	if InCombat(no) DemonologyPrecombatShortCdActions()
+	if not InCombat() DemonologyPrecombatShortCdActions()
 	DemonologyDefaultShortCdActions()
 }

 AddIcon specialization=demonology help=shortcd checkbox=opt_warlock_demonology_aoe
 {
-	if InCombat(no) DemonologyPrecombatShortCdActions()
+	if not InCombat() DemonologyPrecombatShortCdActions()
 	DemonologyDefaultShortCdActions()
 }

 AddIcon specialization=demonology help=main enemies=1
 {
-	if InCombat(no) DemonologyPrecombatActions()
-	DemonologyDefaultActions()
-}
-
-AddIcon specialization=demonology help=predict enemies=1 checkbox=!opt_warlock_demonology_aoe
-{
-	if InCombat(no) DemonologyPrecombatPredictActions()
-	DemonologyDefaultPredictActions()
+	if not InCombat() DemonologyPrecombatMainActions()
+	DemonologyDefaultMainActions()
 }

 AddIcon specialization=demonology help=aoe checkbox=opt_warlock_demonology_aoe
 {
-	if InCombat(no) DemonologyPrecombatActions()
-	DemonologyDefaultActions()
+	if not InCombat() DemonologyPrecombatMainActions()
+	DemonologyDefaultMainActions()
 }

 AddIcon specialization=demonology help=cd enemies=1 checkbox=!opt_warlock_demonology_aoe
 {
-	if InCombat(no) DemonologyPrecombatCdActions()
+	if not InCombat() DemonologyPrecombatCdActions()
 	DemonologyDefaultCdActions()
 }

 AddIcon specialization=demonology help=cd checkbox=opt_warlock_demonology_aoe
 {
-	if InCombat(no) DemonologyPrecombatCdActions()
+	if not InCombat() DemonologyPrecombatCdActions()
 	DemonologyDefaultCdActions()
 }

@@ -843,43 +686,37 @@ AddCheckBox(opt_warlock_destruction_aoe L(AOE) specialization=destruction defaul

 AddIcon specialization=destruction help=shortcd enemies=1 checkbox=!opt_warlock_destruction_aoe
 {
-	if InCombat(no) DestructionPrecombatShortCdActions()
+	if not InCombat() DestructionPrecombatShortCdActions()
 	DestructionDefaultShortCdActions()
 }

 AddIcon specialization=destruction help=shortcd checkbox=opt_warlock_destruction_aoe
 {
-	if InCombat(no) DestructionPrecombatShortCdActions()
+	if not InCombat() DestructionPrecombatShortCdActions()
 	DestructionDefaultShortCdActions()
 }

 AddIcon specialization=destruction help=main enemies=1
 {
-	if InCombat(no) DestructionPrecombatActions()
-	DestructionDefaultActions()
-}
-
-AddIcon specialization=destruction help=predict enemies=1 checkbox=!opt_warlock_destruction_aoe
-{
-	if InCombat(no) DestructionPrecombatPredictActions()
-	DestructionDefaultPredictActions()
+	if not InCombat() DestructionPrecombatMainActions()
+	DestructionDefaultMainActions()
 }

 AddIcon specialization=destruction help=aoe checkbox=opt_warlock_destruction_aoe
 {
-	if InCombat(no) DestructionPrecombatActions()
-	DestructionDefaultActions()
+	if not InCombat() DestructionPrecombatMainActions()
+	DestructionDefaultMainActions()
 }

 AddIcon specialization=destruction help=cd enemies=1 checkbox=!opt_warlock_destruction_aoe
 {
-	if InCombat(no) DestructionPrecombatCdActions()
+	if not InCombat() DestructionPrecombatCdActions()
 	DestructionDefaultCdActions()
 }

 AddIcon specialization=destruction help=cd checkbox=opt_warlock_destruction_aoe
 {
-	if InCombat(no) DestructionPrecombatCdActions()
+	if not InCombat() DestructionPrecombatCdActions()
 	DestructionDefaultCdActions()
 }
 ]]
diff --git a/scripts/ovale_warrior.lua b/scripts/ovale_warrior.lua
index 9ea759a..b1ab8aa 100644
--- a/scripts/ovale_warrior.lua
+++ b/scripts/ovale_warrior.lua
@@ -53,25 +53,30 @@ AddFunction InterruptActions
 #	talents=1321322
 #	glyphs=unending_rage/heroic_leap/sweeping_strikes

-# ActionList: ArmsDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction ArmsDefaultActions
+AddFunction ArmsDefaultMainActions
 {
 	#auto_attack
+	#call_action_list,name=movement,if=movement.distance>5
+	if 0 > 5 ArmsMovementMainActions()
 	#call_action_list,name=single,if=active_enemies=1
-	if Enemies() == 1 ArmsSingleActions()
+	if Enemies() == 1 ArmsSingleMainActions()
 	#call_action_list,name=aoe,if=active_enemies>1
-	if Enemies() > 1 ArmsAoeActions()
+	if Enemies() > 1 ArmsAoeMainActions()
 }

 AddFunction ArmsDefaultShortCdActions
 {
 	#charge
 	if target.InRange(charge) Spell(charge)
-	# CHANGE: Get within melee range of the target.
-	GetInMeleeRange()
+	#auto_attack
+	#call_action_list,name=movement,if=movement.distance>5
+	if 0 > 5 ArmsMovementShortCdActions()
 	#heroic_leap,if=(raid_event.movement.distance>25&raid_event.movement.in>45)|!raid_event.movement.exists
 	if { 0 > 25 and 600 > 45 or not False(raid_event_movement_exists) } and target.InRange(charge) Spell(heroic_leap)
+	# CHANGE: Get within melee range of the target.
+	GetInMeleeRange()
 	#call_action_list,name=single,if=active_enemies=1
 	if Enemies() == 1 ArmsSingleShortCdActions()
 	#call_action_list,name=aoe,if=active_enemies>1
@@ -96,15 +101,11 @@ AddFunction ArmsDefaultCdActions
 	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) and target.DebuffPresent(colossus_smash_debuff) or BuffPresent(recklessness_buff) Spell(berserking)
 	#arcane_torrent,if=rage<rage.max-40
 	if Rage() < MaxRage() - 40 Spell(arcane_torrent_rage)
-	#call_action_list,name=single,if=active_enemies=1
-	if Enemies() == 1 ArmsSingleCdActions()
-	#call_action_list,name=aoe,if=active_enemies>1
-	if Enemies() > 1 ArmsAoeCdActions()
 }

-# ActionList: ArmsAoeActions --> main, shortcd, cd
+### actions.aoe

-AddFunction ArmsAoeActions
+AddFunction ArmsAoeMainActions
 {
 	#sweeping_strikes
 	Spell(sweeping_strikes)
@@ -134,15 +135,12 @@ AddFunction ArmsAoeShortCdActions
 		#bladestorm
 		Spell(bladestorm)

-		unless target.DebuffPresent(rend_debuff) and Spell(colossus_smash)
-			or SpellCooldown(colossus_smash) > 1.5 and target.HealthPercent() > 20 and Enemies() == 2 and Spell(mortal_strike)
-			or { { Rage() > 60 or Enemies() == 2 } and SpellCooldown(colossus_smash) > ExecuteTime(execute_arms) or target.DebuffPresent(colossus_smash_debuff) or target.TimeToDie() < 5 } and Spell(execute_arms)
+		unless target.DebuffPresent(rend_debuff) and Spell(colossus_smash) or SpellCooldown(colossus_smash) > 1.5 and target.HealthPercent() > 20 and Enemies() == 2 and Spell(mortal_strike) or { { Rage() > 60 or Enemies() == 2 } and SpellCooldown(colossus_smash) > ExecuteTime(execute_arms) or target.DebuffPresent(colossus_smash_debuff) or target.TimeToDie() < 5 } and Spell(execute_arms)
 		{
 			#dragon_roar,if=cooldown.colossus_smash.remains>1.5&!debuff.colossus_smash.up
 			if SpellCooldown(colossus_smash) > 1.5 and not target.DebuffPresent(colossus_smash_debuff) Spell(dragon_roar)

-			unless SpellCooldown(colossus_smash) > 1.5 and { target.HealthPercent() > 20 or Enemies() > 3 } and Spell(whirlwind)
-				or not target.DebuffPresent(rend_debuff) and target.TimeToDie() > 8 and Spell(rend)
+			unless SpellCooldown(colossus_smash) > 1.5 and { target.HealthPercent() > 20 or Enemies() > 3 } and Spell(whirlwind) or not target.DebuffPresent(rend_debuff) and target.TimeToDie() > 8 and Spell(rend)
 			{
 				#siegebreaker
 				Spell(siegebreaker)
@@ -155,38 +153,49 @@ AddFunction ArmsAoeShortCdActions
 	}
 }

-AddFunction ArmsAoeCdActions {}
+### actions.movement
+
+AddFunction ArmsMovementMainActions
+{
+	#heroic_throw
+	Spell(heroic_throw)
+}
+
+AddFunction ArmsMovementShortCdActions
+{
+	#heroic_leap
+	if target.InRange(charge) Spell(heroic_leap)
+	#storm_bolt
+	Spell(storm_bolt)
+}

-# ActionList: ArmsPrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction ArmsPrecombatActions
+AddFunction ArmsPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=blackrock_barbecue
-	#stance,choose=battle
-	Spell(battle_stance)
 	# CHANGE: Apply raid buffs.
 	if not BuffPresent(attack_power_multiplier_buff any=1) Spell(battle_shout)
 	if not BuffPresent(stamina_buff any=1) and not BuffPresent(attack_power_multiplier_buff) Spell(commanding_shout)
-	#snapshot_stats
+	#stance,choose=battle
+	Spell(battle_stance)
 }

-AddFunction ArmsPrecombatShortCdActions {}
-
 AddFunction ArmsPrecombatCdActions
 {
-	unless Spell(battle_stance)
-		or not BuffPresent(stamina_buff any=1) and not BuffPresent(attack_power_multiplier_buff) and Spell(commanding_shout)
-		or not BuffPresent(attack_power_multiplier_buff any=1) and Spell(battle_shout)
+	# CHANGE: Apply raid buffs.
+	unless not BuffPresent(attack_power_multiplier_buff any=1) and Spell(battle_shout) or not BuffPresent(stamina_buff any=1) and not BuffPresent(attack_power_multiplier_buff) and Spell(commanding_shout) or Spell(battle_stance)
 	{
+		#snapshot_stats
 		#potion,name=draenic_strength
 		UsePotionStrength()
 	}
 }

-# ActionList: ArmsSingleActions --> main, shortcd, cd
+### actions.single

-AddFunction ArmsSingleActions
+AddFunction ArmsSingleMainActions
 {
 	#rend,if=!ticking&target.time_to_die>4
 	if not target.DebuffPresent(rend_debuff) and target.TimeToDie() > 4 Spell(rend)
@@ -227,11 +236,7 @@ AddFunction ArmsSingleShortCdActions
 				#dragon_roar,if=!debuff.colossus_smash.up
 				if not target.DebuffPresent(colossus_smash_debuff) Spell(dragon_roar)

-				unless not target.DebuffPresent(colossus_smash_debuff) and target.TimeToDie() > 4 and target.DebuffRemaining(rend_debuff) < 5.4 Spell(rend)
-					or { Rage() >= 60 and SpellCooldown(colossus_smash) > ExecuteTime(execute_arms) or target.DebuffPresent(colossus_smash_debuff) or BuffPresent(sudden_death_buff) or target.TimeToDie() < 5 } and Spell(execute_arms)
-					or Rage() < 40 and target.HealthPercent() > 20 and SpellCooldown(colossus_smash) > 1 and SpellCooldown(mortal_strike) > 1 and Spell(impending_victory)
-					or { Rage() > 20 or SpellCooldown(colossus_smash) > ExecuteTime(slam) } and target.HealthPercent() > 20 and SpellCooldown(colossus_smash) > 1 and SpellCooldown(mortal_strike) > 1 and Spell(slam)
-					or not Talent(slam_talent) and target.HealthPercent() > 20 and { Rage() >= 40 or ArmorSetBonus(T17 4) or target.DebuffPresent(colossus_smash_debuff) } and SpellCooldown(colossus_smash) > 1 and SpellCooldown(mortal_strike) > 1 and Spell(whirlwind)
+				unless not target.DebuffPresent(colossus_smash_debuff) and target.TimeToDie() > 4 and target.DebuffRemaining(rend_debuff) < 5.4 and Spell(rend) or { Rage() >= 60 and SpellCooldown(colossus_smash) > ExecuteTime(execute_arms) or target.DebuffPresent(colossus_smash_debuff) or BuffPresent(sudden_death_buff) or target.TimeToDie() < 5 } and Spell(execute_arms) or Rage() < 40 and target.HealthPercent() > 20 and SpellCooldown(colossus_smash) > 1 and SpellCooldown(mortal_strike) > 1 and Spell(impending_victory) or { Rage() > 20 or SpellCooldown(colossus_smash) > ExecuteTime(slam) } and target.HealthPercent() > 20 and SpellCooldown(colossus_smash) > 1 and SpellCooldown(mortal_strike) > 1 and Spell(slam) or not Talent(slam_talent) and target.HealthPercent() > 20 and { Rage() >= 40 or ArmorSetBonus(T17 4) or target.DebuffPresent(colossus_smash_debuff) } and SpellCooldown(colossus_smash) > 1 and SpellCooldown(mortal_strike) > 1 and Spell(whirlwind)
 				{
 					#shockwave
 					Spell(shockwave)
@@ -241,8 +246,6 @@ AddFunction ArmsSingleShortCdActions
 	}
 }

-AddFunction ArmsSingleCdActions {}
-
 ###
 ### Fury (Single-Minded Fury)
 ###
@@ -252,37 +255,38 @@ AddFunction ArmsSingleCdActions {}
 #	talents=1321321
 #	glyphs=unending_rage/raging_wind/heroic_leap

-# ActionList: FurySingleMindedFuryDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction FurySingleMindedFuryDefaultActions
+AddFunction FurySingleMindedFuryDefaultMainActions
 {
 	#auto_attack
 	#call_action_list,name=movement,if=movement.distance>5
-	if 0 > 5 FurySingleMindedFuryMovementActions()
+	if 0 > 5 FurySingleMindedFuryMovementMainActions()
 	#call_action_list,name=single_target,if=(raid_event.adds.cooldown<60&raid_event.adds.count>2&active_enemies=1)|raid_event.movement.cooldown<5
-	if 600 < 60 and 0 > 2 and Enemies() == 1 or 600 < 5 FurySingleMindedFurySingleTargetActions()
+	if 600 < 60 and 0 > 2 and Enemies() == 1 or 600 < 5 FurySingleMindedFurySingleTargetMainActions()
 	#call_action_list,name=single_target,if=active_enemies=1
-	if Enemies() == 1 FurySingleMindedFurySingleTargetActions()
+	if Enemies() == 1 FurySingleMindedFurySingleTargetMainActions()
 	#call_action_list,name=two_targets,if=active_enemies=2
-	if Enemies() == 2 FurySingleMindedFuryTwoTargetsActions()
+	if Enemies() == 2 FurySingleMindedFuryTwoTargetsMainActions()
 	#call_action_list,name=three_targets,if=active_enemies=3
-	if Enemies() == 3 FurySingleMindedFuryThreeTargetsActions()
+	if Enemies() == 3 FurySingleMindedFuryThreeTargetsMainActions()
 	#call_action_list,name=aoe,if=active_enemies>3
-	if Enemies() > 3 FurySingleMindedFuryAoeActions()
+	if Enemies() > 3 FurySingleMindedFuryAoeMainActions()
 }

 AddFunction FurySingleMindedFuryDefaultShortCdActions
 {
 	#charge
 	if target.InRange(charge) Spell(charge)
-	# CHANGE: Get within melee range of the target.
-	GetInMeleeRange()
+	#auto_attack
 	#call_action_list,name=movement,if=movement.distance>5
 	if 0 > 5 FurySingleMindedFuryMovementShortCdActions()
 	#berserker_rage,if=buff.enrage.down|(talent.unquenchable_thirst.enabled&buff.raging_blow.down)
 	if BuffExpires(enrage_buff any=1) or Talent(unquenchable_thirst_talent) and BuffExpires(raging_blow_buff) Spell(berserker_rage)
 	#heroic_leap,if=(raid_event.movement.distance>25&raid_event.movement.in>45)|!raid_event.movement.exists
 	if { 0 > 25 and 600 > 45 or not False(raid_event_movement_exists) } and target.InRange(charge) Spell(heroic_leap)
+	# CHANGE: Get within melee range of the target.
+	GetInMeleeRange()
 	#call_action_list,name=single_target,if=(raid_event.adds.cooldown<60&raid_event.adds.count>2&active_enemies=1)|raid_event.movement.cooldown<5
 	if 600 < 60 and 0 > 2 and Enemies() == 1 or 600 < 5 FurySingleMindedFurySingleTargetShortCdActions()
 	#call_action_list,name=single_target,if=active_enemies=1
@@ -299,8 +303,6 @@ AddFunction FurySingleMindedFuryDefaultCdActions
 {
 	# CHANGE: Add interrupt actions missing from SimulationCraft action list.
 	InterruptActions()
-	#call_action_list,name=movement,if=movement.distance>5
-	if 0 > 5 FurySingleMindedFuryMovementCdActions()
 	#potion,name=draenic_strength,if=(target.health.pct<20&buff.recklessness.up)|target.time_to_die<=25
 	if target.HealthPercent() < 20 and BuffPresent(recklessness_buff) or target.TimeToDie() <= 25 UsePotionStrength()
 	#call_action_list,name=single_target,if=(raid_event.adds.cooldown<60&raid_event.adds.count>2&active_enemies=1)|raid_event.movement.cooldown<5
@@ -325,9 +327,9 @@ AddFunction FurySingleMindedFuryDefaultCdActions
 	if Enemies() > 3 FurySingleMindedFuryAoeCdActions()
 }

-# ActionList: FurySingleMindedFuryAoeActions --> main, shortcd, cd
+### actions.aoe

-AddFunction FurySingleMindedFuryAoeActions
+AddFunction FurySingleMindedFuryAoeMainActions
 {
 	#raging_blow,if=buff.meat_cleaver.stack>=3&buff.enrage.up
 	if BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(enrage_buff any=1) and BuffPresent(raging_blow_buff) Spell(raging_blow)
@@ -350,15 +352,12 @@ AddFunction FurySingleMindedFuryAoeShortCdActions
 	#ravager,if=buff.bloodbath.up|!talent.bloodbath.enabled
 	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(ravager)

-	unless BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(enrage_buff any=1) and BuffPresent(raging_blow_buff) and Spell(raging_blow)
-		or { BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) } and Spell(bloodthirst)
-		or BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(raging_blow_buff) and Spell(raging_blow)
+	unless BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(enrage_buff any=1) and BuffPresent(raging_blow_buff) and Spell(raging_blow) or { BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) } and Spell(bloodthirst) or BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(raging_blow_buff) and Spell(raging_blow)
 	{
 		#bladestorm,if=buff.enrage.remains>6
 		if BuffRemaining(enrage_buff any=1) > 6 Spell(bladestorm)

-		unless Spell(whirlwind)
-			or BuffPresent(sudden_death_buff) and Spell(execute)
+		unless Spell(whirlwind) or BuffPresent(sudden_death_buff) and Spell(execute)
 		{
 			#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
 			if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
@@ -371,30 +370,21 @@ AddFunction FurySingleMindedFuryAoeCdActions
 	#bloodbath
 	Spell(bloodbath)

-	unless { BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) } and Spell(ravager)
-		or BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(enrage_buff any=1) and BuffPresent(raging_blow_buff) and Spell(raging_blow)
-		or { BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) } and Spell(bloodthirst)
-		or BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(raging_blow_buff) and Spell(raging_blow)
+	unless { BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) } and Spell(ravager) or BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(enrage_buff any=1) and BuffPresent(raging_blow_buff) and Spell(raging_blow) or { BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) } and Spell(bloodthirst) or BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(raging_blow_buff) and Spell(raging_blow)
 	{
-		# CHANGE: Synchronize Recklessness with Bladestorm's conditions.
+		# CHANGE: Synchronize with Bladestorm's conditions.
 		#recklessness,sync=bladestorm
 		#if not SpellCooldown(bladestorm) > 0 Spell(recklessness)
-		#bladestorm,if=buff.enrage.remains>6
 		if BuffRemaining(enrage_buff any=1) > 6 and not SpellCooldown(bladestorm) > 0 Spell(recklessness)
 	}
 }

-AddFunction FurySingleMindedFuryAoeCdActions {}
-
-# ActionList: FurySingleMindedFuryMovementActions --> main, shortcd, cd
+### actions.movement

-AddFunction FurySingleMindedFuryMovementActions
+AddFunction FurySingleMindedFuryMovementMainActions
 {
-	unless Spell(storm_bolt)
-	{
-		#heroic_throw
-		Spell(heroic_throw)
-	}
+	#heroic_throw
+	Spell(heroic_throw)
 }

 AddFunction FurySingleMindedFuryMovementShortCdActions
@@ -405,38 +395,33 @@ AddFunction FurySingleMindedFuryMovementShortCdActions
 	Spell(storm_bolt)
 }

-AddFunction FurySingleMindedFuryMovementCdActions {}
-
-# ActionList: FurySingleMindedFuryPrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction FurySingleMindedFuryPrecombatActions
+AddFunction FurySingleMindedFuryPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=blackrock_barbecue
-	#stance,choose=battle
-	Spell(battle_stance)
 	# CHANGE: Apply raid buffs.
 	if not BuffPresent(attack_power_multiplier_buff any=1) Spell(battle_shout)
 	if not BuffPresent(stamina_buff any=1) and not BuffPresent(attack_power_multiplier_buff) Spell(commanding_shout)
-	#snapshot_stats
+	#stance,choose=battle
+	Spell(battle_stance)
 }

-AddFunction FurySingleMindedFuryPrecombatShortCdActions {}
-
 AddFunction FurySingleMindedFuryPrecombatCdActions
 {
-	unless Spell(battle_stance)
-		or not BuffPresent(stamina_buff any=1) and not BuffPresent(attack_power_multiplier_buff) and Spell(commanding_shout)
-		or not BuffPresent(attack_power_multiplier_buff any=1) and Spell(battle_shout)
+	# CHANGE: Apply raid buffs.
+	unless not BuffPresent(attack_power_multiplier_buff any=1) and Spell(battle_shout) or not BuffPresent(stamina_buff any=1) and not BuffPresent(attack_power_multiplier_buff) and Spell(commanding_shout) or Spell(battle_stance)
 	{
+		#snapshot_stats
 		#potion,name=draenic_strength
 		UsePotionStrength()
 	}
 }

-# ActionList: FurySingleMindedFurySingleTargetActions --> main, shortcd, cd
+### actions.single_target

-AddFunction FurySingleMindedFurySingleTargetActions
+AddFunction FurySingleMindedFurySingleTargetMainActions
 {
 	#wild_strike,if=rage>110&target.health.pct>20
 	if Rage() > 110 and target.HealthPercent() > 20 Spell(wild_strike)
@@ -460,8 +445,7 @@ AddFunction FurySingleMindedFurySingleTargetActions

 AddFunction FurySingleMindedFurySingleTargetShortCdActions
 {
-	unless Rage() > 110 and target.HealthPercent() > 20 and Spell(wild_strike)
-		or { not Talent(unquenchable_thirst_talent) and Rage() < 80 or BuffExpires(enrage_buff any=1) } and Spell(bloodthirst)
+	unless Rage() > 110 and target.HealthPercent() > 20 and Spell(wild_strike) or { not Talent(unquenchable_thirst_talent) and Rage() < 80 or BuffExpires(enrage_buff any=1) } and Spell(bloodthirst)
 	{
 		#ravager,if=buff.bloodbath.up|(!talent.bloodbath.enabled&(!raid_event.adds.exists|raid_event.adds.cooldown>60|target.time_to_die<40))
 		if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) and { not False(raid_event_adds_exists) or 600 > 60 or target.TimeToDie() < 40 } Spell(ravager)
@@ -473,14 +457,12 @@ AddFunction FurySingleMindedFurySingleTargetShortCdActions
 			#storm_bolt
 			Spell(storm_bolt)

-			unless BuffPresent(bloodsurge_buff) and Spell(wild_strike)
-				or { BuffPresent(enrage_buff any=1) or target.TimeToDie() < 12 } and Spell(execute)
+			unless BuffPresent(bloodsurge_buff) and Spell(wild_strike) or { BuffPresent(enrage_buff any=1) or target.TimeToDie() < 12 } and Spell(execute)
 			{
 				#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
 				if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)

-				unless BuffPresent(raging_blow_buff) and Spell(raging_blow)
-					or BuffPresent(enrage_buff any=1) and target.HealthPercent() > 20 and Spell(wild_strike)
+				unless BuffPresent(raging_blow_buff) and Spell(raging_blow) or BuffPresent(enrage_buff any=1) and target.HealthPercent() > 20 and Spell(wild_strike)
 				{
 					#bladestorm,if=!raid_event.adds.exists
 					if not False(raid_event_adds_exists) Spell(bladestorm)
@@ -500,9 +482,9 @@ AddFunction FurySingleMindedFurySingleTargetCdActions
 	if target.HealthPercent() < 20 and False(raid_event_adds_exists) Spell(recklessness)
 }

-# ActionList: FurySingleMindedFuryThreeTargetsActions --> main, shortcd, cd
+### actions.three_targets

-AddFunction FurySingleMindedFuryThreeTargetsActions
+AddFunction FurySingleMindedFuryThreeTargetsMainActions
 {
 	#bloodthirst,if=buff.enrage.down|rage<50|buff.raging_blow.down
 	if BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) Spell(bloodthirst)
@@ -510,8 +492,6 @@ AddFunction FurySingleMindedFuryThreeTargetsActions
 	if BuffStacks(meat_cleaver_buff) >= 2 and BuffPresent(raging_blow_buff) Spell(raging_blow)
 	#execute,if=buff.sudden_death.react
 	if BuffPresent(sudden_death_buff) Spell(execute)
-	#execute,target=2
-	#execute,target=3
 	#whirlwind
 	Spell(whirlwind)
 	#bloodthirst
@@ -527,10 +507,10 @@ AddFunction FurySingleMindedFuryThreeTargetsShortCdActions
 	#bladestorm,if=buff.enrage.up
 	if BuffPresent(enrage_buff any=1) Spell(bladestorm)

-	unless { BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) } and Spell(bloodthirst)
-		or BuffStacks(meat_cleaver_buff) >= 2 and BuffPresent(raging_blow_buff) and Spell(raging_blow)
-		or BuffPresent(sudden_death_buff) and Spell(execute)
+	unless { BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) } and Spell(bloodthirst) or BuffStacks(meat_cleaver_buff) >= 2 and BuffPresent(raging_blow_buff) and Spell(raging_blow) or BuffPresent(sudden_death_buff) and Spell(execute)
 	{
+		#execute,target=2
+		#execute,target=3
 		#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
 		if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
 	}
@@ -542,9 +522,9 @@ AddFunction FurySingleMindedFuryThreeTargetsCdActions
 	Spell(bloodbath)
 }

-# ActionList: FurySingleMindedFuryTwoTargetsActions --> main, shortcd, cd
+### actions.two_targets

-AddFunction FurySingleMindedFuryTwoTargetsActions
+AddFunction FurySingleMindedFuryTwoTargetsMainActions
 {
 	#bloodthirst,if=buff.enrage.down|rage<50|buff.raging_blow.down
 	if BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) Spell(bloodthirst)
@@ -590,37 +570,38 @@ AddFunction FurySingleMindedFuryTwoTargetsCdActions
 #	talents=1321321
 #	glyphs=unending_rage/raging_wind/heroic_leap

-# ActionList: FuryTitansGripDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction FuryTitansGripDefaultActions
+AddFunction FuryTitansGripDefaultMainActions
 {
 	#auto_attack
 	#call_action_list,name=movement,if=movement.distance>5
-	if 0 > 5 FuryTitansGripMovementActions()
+	if 0 > 5 FuryTitansGripMovementMainActions()
 	#call_action_list,name=single_target,if=(raid_event.adds.cooldown<60&raid_event.adds.count>2&active_enemies=1)|raid_event.movement.cooldown<5
-	if 600 < 60 and 0 > 2 and Enemies() == 1 or 600 < 5 FuryTitansGripSingleTargetActions()
+	if 600 < 60 and 0 > 2 and Enemies() == 1 or 600 < 5 FuryTitansGripSingleTargetMainActions()
 	#call_action_list,name=single_target,if=active_enemies=1
-	if Enemies() == 1 FuryTitansGripSingleTargetActions()
+	if Enemies() == 1 FuryTitansGripSingleTargetMainActions()
 	#call_action_list,name=two_targets,if=active_enemies=2
-	if Enemies() == 2 FuryTitansGripTwoTargetsActions()
+	if Enemies() == 2 FuryTitansGripTwoTargetsMainActions()
 	#call_action_list,name=three_targets,if=active_enemies=3
-	if Enemies() == 3 FuryTitansGripThreeTargetsActions()
+	if Enemies() == 3 FuryTitansGripThreeTargetsMainActions()
 	#call_action_list,name=aoe,if=active_enemies>3
-	if Enemies() > 3 FuryTitansGripAoeActions()
+	if Enemies() > 3 FuryTitansGripAoeMainActions()
 }

 AddFunction FuryTitansGripDefaultShortCdActions
 {
 	#charge
 	if target.InRange(charge) Spell(charge)
-	# CHANGE: Get within melee range of the target.
-	GetInMeleeRange()
+	#auto_attack
 	#call_action_list,name=movement,if=movement.distance>5
 	if 0 > 5 FuryTitansGripMovementShortCdActions()
 	#berserker_rage,if=buff.enrage.down|(talent.unquenchable_thirst.enabled&buff.raging_blow.down)
 	if BuffExpires(enrage_buff any=1) or Talent(unquenchable_thirst_talent) and BuffExpires(raging_blow_buff) Spell(berserker_rage)
 	#heroic_leap,if=(raid_event.movement.distance>25&raid_event.movement.in>45)|!raid_event.movement.exists
 	if { 0 > 25 and 600 > 45 or not False(raid_event_movement_exists) } and target.InRange(charge) Spell(heroic_leap)
+	# CHANGE: Get within melee range of the target.
+	GetInMeleeRange()
 	#call_action_list,name=single_target,if=(raid_event.adds.cooldown<60&raid_event.adds.count>2&active_enemies=1)|raid_event.movement.cooldown<5
 	if 600 < 60 and 0 > 2 and Enemies() == 1 or 600 < 5 FuryTitansGripSingleTargetShortCdActions()
 	#call_action_list,name=single_target,if=active_enemies=1
@@ -637,8 +618,6 @@ AddFunction FuryTitansGripDefaultCdActions
 {
 	# CHANGE: Add interrupt actions missing from SimulationCraft action list.
 	InterruptActions()
-	#call_action_list,name=movement,if=movement.distance>5
-	if 0 > 5 FuryTitansGripMovementCdActions()
 	#potion,name=draenic_strength,if=(target.health.pct<20&buff.recklessness.up)|target.time_to_die<=25
 	if target.HealthPercent() < 20 and BuffPresent(recklessness_buff) or target.TimeToDie() <= 25 UsePotionStrength()
 	#call_action_list,name=single_target,if=(raid_event.adds.cooldown<60&raid_event.adds.count>2&active_enemies=1)|raid_event.movement.cooldown<5
@@ -663,9 +642,9 @@ AddFunction FuryTitansGripDefaultCdActions
 	if Enemies() > 3 FuryTitansGripAoeCdActions()
 }

-# ActionList: FuryTitansGripAoeActions --> main, shortcd, cd
+### actions.aoe

-AddFunction FuryTitansGripAoeActions
+AddFunction FuryTitansGripAoeMainActions
 {
 	#raging_blow,if=buff.meat_cleaver.stack>=3&buff.enrage.up
 	if BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(enrage_buff any=1) and BuffPresent(raging_blow_buff) Spell(raging_blow)
@@ -688,15 +667,12 @@ AddFunction FuryTitansGripAoeShortCdActions
 	#ravager,if=buff.bloodbath.up|!talent.bloodbath.enabled
 	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(ravager)

-	unless BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(enrage_buff any=1) and BuffPresent(raging_blow_buff) and Spell(raging_blow)
-		or { BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) } and Spell(bloodthirst)
-		or BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(raging_blow_buff) and Spell(raging_blow)
+	unless BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(enrage_buff any=1) and BuffPresent(raging_blow_buff) and Spell(raging_blow) or { BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) } and Spell(bloodthirst) or BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(raging_blow_buff) and Spell(raging_blow)
 	{
 		#bladestorm,if=buff.enrage.remains>6
 		if BuffRemaining(enrage_buff any=1) > 6 Spell(bladestorm)

-		unless Spell(whirlwind)
-			or BuffPresent(sudden_death_buff) and Spell(execute)
+		unless Spell(whirlwind) or BuffPresent(sudden_death_buff) and Spell(execute)
 		{
 			#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
 			if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
@@ -709,28 +685,21 @@ AddFunction FuryTitansGripAoeCdActions
 	#bloodbath
 	Spell(bloodbath)

-	unless { BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) } and Spell(ravager)
-		or BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(enrage_buff any=1) and BuffPresent(raging_blow_buff) and Spell(raging_blow)
-		or { BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) } and Spell(bloodthirst)
-		or BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(raging_blow_buff) and Spell(raging_blow)
+	unless { BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) } and Spell(ravager) or BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(enrage_buff any=1) and BuffPresent(raging_blow_buff) and Spell(raging_blow) or { BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) } and Spell(bloodthirst) or BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(raging_blow_buff) and Spell(raging_blow)
 	{
-		# CHANGE: Synchronize Recklessness with Bladestorm's conditions.
+		# CHANGE: Synchronize with Bladestorm's conditions.
 		#recklessness,sync=bladestorm
 		#if not SpellCooldown(bladestorm) > 0 Spell(recklessness)
-		#bladestorm,if=buff.enrage.remains>6
 		if BuffRemaining(enrage_buff any=1) > 6 and not SpellCooldown(bladestorm) > 0 Spell(recklessness)
 	}
 }

-# ActionList: FuryTitansGripMovementActions --> main, shortcd, cd
+### actions.movement

-AddFunction FuryTitansGripMovementActions
+AddFunction FuryTitansGripMovementMainActions
 {
-	unless Spell(storm_bolt)
-	{
-		#heroic_throw
-		Spell(heroic_throw)
-	}
+	#heroic_throw
+	Spell(heroic_throw)
 }

 AddFunction FuryTitansGripMovementShortCdActions
@@ -741,38 +710,33 @@ AddFunction FuryTitansGripMovementShortCdActions
 	Spell(storm_bolt)
 }

-AddFunction FuryTitansGripMovementCdActions {}
-
-# ActionList: FuryTitansGripPrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction FuryTitansGripPrecombatActions
+AddFunction FuryTitansGripPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=blackrock_barbecue
-	#stance,choose=battle
-	Spell(battle_stance)
 	# CHANGE: Apply raid buffs.
 	if not BuffPresent(attack_power_multiplier_buff any=1) Spell(battle_shout)
 	if not BuffPresent(stamina_buff any=1) and not BuffPresent(attack_power_multiplier_buff) Spell(commanding_shout)
-	#snapshot_stats
+	#stance,choose=battle
+	Spell(battle_stance)
 }

-AddFunction FuryTitansGripPrecombatShortCdActions {}
-
 AddFunction FuryTitansGripPrecombatCdActions
 {
-	unless Spell(battle_stance)
-		or not BuffPresent(stamina_buff any=1) and not BuffPresent(attack_power_multiplier_buff) and Spell(commanding_shout)
-		or not BuffPresent(attack_power_multiplier_buff any=1) and Spell(battle_shout)
+	# CHANGE: Apply raid buffs.
+	unless not BuffPresent(attack_power_multiplier_buff any=1) and Spell(battle_shout) or not BuffPresent(stamina_buff any=1) and not BuffPresent(attack_power_multiplier_buff) and Spell(commanding_shout) or Spell(battle_stance)
 	{
+		#snapshot_stats
 		#potion,name=draenic_strength
 		UsePotionStrength()
 	}
 }

-# ActionList: FuryTitansGripSingleTargetActions --> main, shortcd, cd
+### actions.single_target

-AddFunction FuryTitansGripSingleTargetActions
+AddFunction FuryTitansGripSingleTargetMainActions
 {
 	#wild_strike,if=rage>110&target.health.pct>20
 	if Rage() > 110 and target.HealthPercent() > 20 Spell(wild_strike)
@@ -796,8 +760,7 @@ AddFunction FuryTitansGripSingleTargetActions

 AddFunction FuryTitansGripSingleTargetShortCdActions
 {
-	unless Rage() > 110 and target.HealthPercent() > 20 and Spell(wild_strike)
-		or { not Talent(unquenchable_thirst_talent) and Rage() < 80 or BuffExpires(enrage_buff any=1) } and Spell(bloodthirst)
+	unless Rage() > 110 and target.HealthPercent() > 20 and Spell(wild_strike) or { not Talent(unquenchable_thirst_talent) and Rage() < 80 or BuffExpires(enrage_buff any=1) } and Spell(bloodthirst)
 	{
 		#ravager,if=buff.bloodbath.up|(!talent.bloodbath.enabled&(!raid_event.adds.exists|raid_event.adds.cooldown>60|target.time_to_die<40))
 		if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) and { not False(raid_event_adds_exists) or 600 > 60 or target.TimeToDie() < 40 } Spell(ravager)
@@ -809,14 +772,12 @@ AddFunction FuryTitansGripSingleTargetShortCdActions
 			#storm_bolt
 			Spell(storm_bolt)

-			unless BuffPresent(bloodsurge_buff) and Spell(wild_strike)
-				or { BuffPresent(enrage_buff any=1) or target.TimeToDie() < 12 } and Spell(execute)
+			unless BuffPresent(bloodsurge_buff) and Spell(wild_strike) or { BuffPresent(enrage_buff any=1) or target.TimeToDie() < 12 } and Spell(execute)
 			{
 				#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
 				if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)

-				unless BuffPresent(raging_blow_buff) and Spell(raging_blow)
-					or BuffPresent(enrage_buff any=1) and target.HealthPercent() > 20 and Spell(wild_strike)
+				unless BuffPresent(raging_blow_buff) and Spell(raging_blow) or BuffPresent(enrage_buff any=1) and target.HealthPercent() > 20 and Spell(wild_strike)
 				{
 					#bladestorm,if=!raid_event.adds.exists
 					if not False(raid_event_adds_exists) Spell(bladestorm)
@@ -836,9 +797,9 @@ AddFunction FuryTitansGripSingleTargetCdActions
 	if target.HealthPercent() < 20 and False(raid_event_adds_exists) Spell(recklessness)
 }

-# ActionList: FuryTitansGripThreeTargetsActions --> main, shortcd, cd
+### actions.three_targets

-AddFunction FuryTitansGripThreeTargetsActions
+AddFunction FuryTitansGripThreeTargetsMainActions
 {
 	#bloodthirst,if=buff.enrage.down|rage<50|buff.raging_blow.down
 	if BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) Spell(bloodthirst)
@@ -846,8 +807,6 @@ AddFunction FuryTitansGripThreeTargetsActions
 	if BuffStacks(meat_cleaver_buff) >= 2 and BuffPresent(raging_blow_buff) Spell(raging_blow)
 	#execute,if=buff.sudden_death.react
 	if BuffPresent(sudden_death_buff) Spell(execute)
-	#execute,target=2
-	#execute,target=3
 	#whirlwind
 	Spell(whirlwind)
 	#bloodthirst
@@ -863,10 +822,10 @@ AddFunction FuryTitansGripThreeTargetsShortCdActions
 	#bladestorm,if=buff.enrage.up
 	if BuffPresent(enrage_buff any=1) Spell(bladestorm)

-	unless { BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) } and Spell(bloodthirst)
-		or BuffStacks(meat_cleaver_buff) >= 2 and BuffPresent(raging_blow_buff) and Spell(raging_blow)
-		or BuffPresent(sudden_death_buff) and Spell(execute)
+	unless { BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) } and Spell(bloodthirst) or BuffStacks(meat_cleaver_buff) >= 2 and BuffPresent(raging_blow_buff) and Spell(raging_blow) or BuffPresent(sudden_death_buff) and Spell(execute)
 	{
+		#execute,target=2
+		#execute,target=3
 		#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
 		if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
 	}
@@ -878,9 +837,9 @@ AddFunction FuryTitansGripThreeTargetsCdActions
 	Spell(bloodbath)
 }

-# ActionList: FuryTitansGripTwoTargetsActions --> main, shortcd, cd
+### actions.two_targets

-AddFunction FuryTitansGripTwoTargetsActions
+AddFunction FuryTitansGripTwoTargetsMainActions
 {
 	#bloodthirst,if=buff.enrage.down|rage<50|buff.raging_blow.down
 	if BuffExpires(enrage_buff any=1) or Rage() < 50 or BuffExpires(raging_blow_buff) Spell(bloodthirst)
@@ -918,6 +877,179 @@ AddFunction FuryTitansGripTwoTargetsCdActions
 }

 ###
+### Protection (Gladiator)
+###
+# Based on SimulationCraft profile "Warrior_Gladiator_T17M".
+#	class=warrior
+#	spec=protection
+#	talents=1133323
+#	glyphs=unending_rage/heroic_leap/cleave
+
+### actions.default
+
+AddFunction ProtectionGladiatorDefaultMainActions
+{
+	#auto_attack
+	#call_action_list,name=movement,if=movement.distance>5
+	if 0 > 5 ProtectionGladiatorMovementMainActions()
+	#call_action_list,name=single,if=active_enemies=1
+	if Enemies() == 1 ProtectionGladiatorSingleMainActions()
+	#call_action_list,name=aoe,if=active_enemies>=2
+	if Enemies() >= 2 ProtectionGladiatorAoeMainActions()
+}
+
+AddFunction ProtectionGladiatorDefaultShortCdActions
+{
+	#charge
+	if target.InRange(charge) Spell(charge)
+	#auto_attack
+	#call_action_list,name=movement,if=movement.distance>5
+	if 0 > 5 ProtectionGladiatorMovementShortCdActions()
+	#shield_charge,if=(!buff.shield_charge.up&!cooldown.shield_slam.remains)|charges=2
+	if not BuffPresent(shield_charge_buff) and not SpellCooldown(shield_slam) > 0 or Charges(shield_charge) == 2 Spell(shield_charge)
+	#berserker_rage,if=buff.enrage.down
+	if BuffExpires(enrage_buff any=1) Spell(berserker_rage)
+	#heroic_leap,if=(raid_event.movement.distance>25&raid_event.movement.in>45)|!raid_event.movement.exists
+	if { 0 > 25 and 600 > 45 or not False(raid_event_movement_exists) } and target.InRange(charge) Spell(heroic_leap)
+	# CHANGE: Get within melee range of the target.
+	GetInMeleeRange()
+	#heroic_strike,if=(buff.shield_charge.up|(buff.unyielding_strikes.up&rage>=50-buff.unyielding_strikes.stack*5))&target.health.pct>20
+	if { BuffPresent(shield_charge_buff) or BuffPresent(unyielding_strikes_buff) and Rage() >= 50 - BuffStacks(unyielding_strikes_buff) * 5 } and target.HealthPercent() > 20 Spell(heroic_strike)
+	#heroic_strike,if=buff.ultimatum.up|rage>=rage.max-20|buff.unyielding_strikes.stack>4|target.time_to_die<10
+	if BuffPresent(ultimatum_buff) or Rage() >= MaxRage() - 20 or BuffStacks(unyielding_strikes_buff) > 4 or target.TimeToDie() < 10 Spell(heroic_strike)
+	#call_action_list,name=single,if=active_enemies=1
+	if Enemies() == 1 ProtectionGladiatorSingleShortCdActions()
+	#call_action_list,name=aoe,if=active_enemies>=2
+	if Enemies() >= 2 ProtectionGladiatorAoeShortCdActions()
+}
+
+AddFunction ProtectionGladiatorDefaultCdActions
+{
+	# CHANGE: Add interrupt actions missing from SimulationCraft action list.
+	InterruptActions()
+	#avatar
+	Spell(avatar)
+	#bloodbath
+	Spell(bloodbath)
+	#blood_fury,if=buff.bloodbath.up|buff.avatar.up|buff.shield_charge.up|target.time_to_die<10
+	if BuffPresent(bloodbath_buff) or BuffPresent(avatar_buff) or BuffPresent(shield_charge_buff) or target.TimeToDie() < 10 Spell(blood_fury_ap)
+	#berserking,if=buff.bloodbath.up|buff.avatar.up|buff.shield_charge.up|target.time_to_die<10
+	if BuffPresent(bloodbath_buff) or BuffPresent(avatar_buff) or BuffPresent(shield_charge_buff) or target.TimeToDie() < 10 Spell(berserking)
+	#arcane_torrent,if=rage<rage.max-40
+	if Rage() < MaxRage() - 40 Spell(arcane_torrent_rage)
+	#potion,name=draenic_armor,if=buff.bloodbath.up|buff.avatar.up|buff.shield_charge.up
+	if BuffPresent(bloodbath_buff) or BuffPresent(avatar_buff) or BuffPresent(shield_charge_buff) UsePotionArmor()
+}
+
+### actions.aoe
+
+AddFunction ProtectionGladiatorAoeMainActions
+{
+	#revenge
+	Spell(revenge)
+	#shield_slam
+	Spell(shield_slam)
+	#thunder_clap,cycle_targets=1,if=dot.deep_wounds.remains<3&active_enemies>4
+	if target.DebuffRemaining(deep_wounds_debuff) < 3 and Enemies() > 4 Spell(thunder_clap)
+	#execute,if=buff.sudden_death.react
+	if BuffPresent(sudden_death_buff) Spell(execute)
+	#thunder_clap,if=active_enemies>6
+	if Enemies() > 6 Spell(thunder_clap)
+	#devastate,cycle_targets=1,if=dot.deep_wounds.remains<5&cooldown.shield_slam.remains>execute_time*0.4
+	if target.DebuffRemaining(deep_wounds_debuff) < 5 and SpellCooldown(shield_slam) > ExecuteTime(devastate) * 0.4 Spell(devastate)
+	#devastate,if=cooldown.shield_slam.remains>execute_time*0.4
+	if SpellCooldown(shield_slam) > ExecuteTime(devastate) * 0.4 Spell(devastate)
+}
+
+AddFunction ProtectionGladiatorAoeShortCdActions
+{
+	unless Spell(revenge) or Spell(shield_slam)
+	{
+		#dragon_roar,if=(buff.bloodbath.up|cooldown.bloodbath.remains>10)|!talent.bloodbath.enabled
+		if BuffPresent(bloodbath_buff) or SpellCooldown(bloodbath) > 10 or not Talent(bloodbath_talent) Spell(dragon_roar)
+		#storm_bolt,if=(buff.bloodbath.up|cooldown.bloodbath.remains>7)|!talent.bloodbath.enabled
+		if BuffPresent(bloodbath_buff) or SpellCooldown(bloodbath) > 7 or not Talent(bloodbath_talent) Spell(storm_bolt)
+
+		unless target.DebuffRemaining(deep_wounds_debuff) < 3 and Enemies() > 4 and Spell(thunder_clap)
+		{
+			#bladestorm,if=buff.shield_charge.down
+			if BuffExpires(shield_charge_buff) Spell(bladestorm)
+		}
+	}
+}
+
+### actions.movement
+
+AddFunction ProtectionGladiatorMovementMainActions
+{
+	#heroic_throw
+	Spell(heroic_throw)
+}
+
+AddFunction ProtectionGladiatorMovementShortCdActions
+{
+	#heroic_leap
+	if target.InRange(charge) Spell(heroic_leap)
+	#shield_charge
+	Spell(shield_charge)
+	#storm_bolt
+	Spell(storm_bolt)
+}
+
+### actions.precombat
+
+AddFunction ProtectionGladiatorPrecombatMainActions
+{
+	#flask,type=greater_draenic_strength_flask
+	#food,type=blackrock_barbecue
+	# CHANGE: Apply raid buffs.
+	if not BuffPresent(attack_power_multiplier_buff any=1) Spell(battle_shout)
+	if not BuffPresent(stamina_buff any=1) and not BuffPresent(attack_power_multiplier_buff) Spell(commanding_shout)
+	#stance,choose=gladiator
+	Spell(gladiator_stance)
+}
+
+AddFunction ProtectionGladiatorPrecombatCdActions
+{
+	# CHANGE: Apply raid buffs.
+	unless not BuffPresent(attack_power_multiplier_buff any=1) and Spell(battle_shout) or not BuffPresent(stamina_buff any=1) and not BuffPresent(attack_power_multiplier_buff) and Spell(commanding_shout) or Spell(gladiator_stance)
+	{
+		#snapshot_stats
+		#potion,name=draenic_armor
+		UsePotionArmor()
+	}
+}
+
+### actions.single
+
+AddFunction ProtectionGladiatorSingleMainActions
+{
+	#devastate,if=buff.unyielding_strikes.stack>0&buff.unyielding_strikes.stack<6&buff.unyielding_strikes.remains<1.5
+	if BuffStacks(unyielding_strikes_buff) > 0 and BuffStacks(unyielding_strikes_buff) < 6 and BuffRemaining(unyielding_strikes_buff) < 1.5 Spell(devastate)
+	#shield_slam
+	Spell(shield_slam)
+	#revenge
+	Spell(revenge)
+	#execute,if=buff.sudden_death.react
+	if BuffPresent(sudden_death_buff) Spell(execute)
+	#execute,if=rage>60&target.health.pct<20
+	if Rage() > 60 and target.HealthPercent() < 20 Spell(execute)
+	#devastate
+	Spell(devastate)
+}
+
+AddFunction ProtectionGladiatorSingleShortCdActions
+{
+	unless BuffStacks(unyielding_strikes_buff) > 0 and BuffStacks(unyielding_strikes_buff) < 6 and BuffRemaining(unyielding_strikes_buff) < 1.5 and Spell(devastate) or Spell(shield_slam) or Spell(revenge) or BuffPresent(sudden_death_buff) and Spell(execute)
+	{
+		#storm_bolt
+		Spell(storm_bolt)
+		#dragon_roar
+		Spell(dragon_roar)
+	}
+}
+
+###
 ### Protection
 ###
 # Based on SimulationCraft profile "Warrior_Protection_T17M".
@@ -926,21 +1058,18 @@ AddFunction FuryTitansGripTwoTargetsCdActions
 #	talents=1113323
 #	glyphs=unending_rage/heroic_leap/cleave

-# ActionList: ProtectionDefaultActions --> main, shortcd, cd
+### actions.default

-AddFunction ProtectionDefaultActions
+AddFunction ProtectionDefaultMainActions
 {
-	#auto_attack
 	#call_action_list,name=prot
-	ProtectionProtActions()
+	ProtectionProtMainActions()
 }

 AddFunction ProtectionDefaultShortCdActions
 {
 	#charge
 	if target.InRange(charge) Spell(charge)
-	# CHANGE: Get within melee range of the target.
-	GetInMeleeRange()
 	#berserker_rage,if=buff.enrage.down
 	if BuffExpires(enrage_buff any=1) Spell(berserker_rage)
 	#call_action_list,name=prot
@@ -951,6 +1080,7 @@ AddFunction ProtectionDefaultCdActions
 {
 	# CHANGE: Add interrupt actions missing from SimulationCraft action list.
 	InterruptActions()
+	#auto_attack
 	#blood_fury,if=buff.bloodbath.up|buff.avatar.up
 	if BuffPresent(bloodbath_buff) or BuffPresent(avatar_buff) Spell(blood_fury_ap)
 	#berserking,if=buff.bloodbath.up|buff.avatar.up
@@ -961,28 +1091,25 @@ AddFunction ProtectionDefaultCdActions
 	ProtectionProtCdActions()
 }

-# ActionList: ProtectionPrecombatActions --> main, shortcd, cd
+### actions.precombat

-AddFunction ProtectionPrecombatActions
+AddFunction ProtectionPrecombatMainActions
 {
 	#flask,type=greater_draenic_stamina_flask
 	#food,type=blackrock_barbecue
-	#stance,choose=defensive
-	Spell(defensive_stance)
 	# CHANGE: Apply raid buffs.
 	if not BuffPresent(stamina_buff any=1) Spell(commanding_shout)
 	if not BuffPresent(attack_power_multiplier_buff any=1) and not BuffPresent(stamina_buff) Spell(battle_shout)
-	#snapshot_stats
+	#stance,choose=defensive
+	Spell(defensive_stance)
 }

-AddFunction ProtectionPrecombatShortCdActions {}
-
 AddFunction ProtectionPrecombatCdActions
 {
-	unless Spell(defensive_stance)
-		or not BuffPresent(attack_power_multiplier_buff any=1) and not BuffPresent(stamina_buff) and Spell(battle_shout)
-		or not BuffPresent(stamina_buff any=1) and Spell(commanding_shout)
+	# CHANGE: Apply raid buffs.
+	unless not BuffPresent(stamina_buff any=1) and Spell(commanding_shout) or not BuffPresent(attack_power_multiplier_buff any=1) and not BuffPresent(stamina_buff) and Spell(battle_shout) or Spell(defensive_stance)
 	{
+		#snapshot_stats
 		#shield_wall
 		Spell(shield_wall)
 		#potion,name=draenic_armor
@@ -990,76 +1117,12 @@ AddFunction ProtectionPrecombatCdActions
 	}
 }

-# ActionList: ProtectionProtAoeActions --> main, shortcd, cd
-
-AddFunction ProtectionProtAoeActions
-{
-	#thunder_clap,if=!dot.deep_wounds.ticking
-	if not target.DebuffPresent(deep_wounds_debuff) Spell(thunder_clap)
-	#shield_slam,if=buff.shield_block.up
-	if BuffPresent(shield_block_buff) Spell(shield_slam)
-	#revenge
-	Spell(revenge)
-	#thunder_clap
-	Spell(thunder_clap)
-	#shield_slam
-	Spell(shield_slam)
-	#shield_slam
-	Spell(shield_slam)
-	#execute,if=buff.sudden_death.react
-	if BuffPresent(sudden_death_buff) Spell(execute)
-	#devastate
-	Spell(devastate)
-}
+### actions.prot

-AddFunction ProtectionProtAoeShortCdActions
-{
-	unless not target.DebuffPresent(deep_wounds_debuff) and Spell(thunder_clap)
-	{
-		#heroic_strike,if=buff.ultimatum.up|rage>110|(talent.unyielding_strikes.enabled&buff.unyielding_strikes.stack>=6)
-		if BuffPresent(ultimatum_buff) or Rage() > 110 or Talent(unyielding_strikes_talent) and BuffStacks(unyielding_strikes_buff) >= 6 Spell(heroic_strike)
-		#heroic_leap,if=(raid_event.movement.distance>25&raid_event.movement.in>45)|!raid_event.movement.exists
-		if { 0 > 25 and 600 > 45 or not False(raid_event_movement_exists) } and target.InRange(charge) Spell(heroic_leap)
-
-		unless BuffPresent(shield_block_buff) and Spell(shield_slam)
-		{
-			#ravager,if=(buff.avatar.up|cooldown.avatar.remains>10)|!talent.avatar.enabled
-			if BuffPresent(avatar_buff) or SpellCooldown(avatar) > 10 or not Talent(avatar_talent) Spell(ravager)
-			#dragon_roar,if=(buff.bloodbath.up|cooldown.bloodbath.remains>10)|!talent.bloodbath.enabled
-			if BuffPresent(bloodbath_buff) or SpellCooldown(bloodbath) > 10 or not Talent(bloodbath_talent) Spell(dragon_roar)
-			#shockwave
-			Spell(shockwave)
-
-			unless Spell(revenge)
-				or Spell(thunder_clap)
-			{
-				#bladestorm
-				Spell(bladestorm)
-
-				unless Spell(shield_slam)
-				{
-					#storm_bolt
-					Spell(storm_bolt)
-				}
-			}
-		}
-	}
-}
-
-AddFunction ProtectionProtAoeCdActions
-{
-	#bloodbath
-	Spell(bloodbath)
-	#avatar
-	Spell(avatar)
-}
-
-# ActionList: ProtectionProtActions --> main, shortcd, cd
-
-AddFunction ProtectionProtActions
+AddFunction ProtectionProtMainActions
 {
 	#call_action_list,name=prot_aoe,if=active_enemies>3
-	if Enemies() > 3 ProtectionProtAoeActions()
+	if Enemies() > 3 ProtectionProtAoeMainActions()
 	#shield_slam
 	Spell(shield_slam)
 	#revenge
@@ -1082,17 +1145,16 @@ AddFunction ProtectionProtShortCdActions
 	if BuffExpires(shield_barrier_tank_buff) and { BuffExpires(shield_block_buff) and Charges(shield_block count=0) < 0.75 or Rage() >= 85 } Spell(shield_barrier_tank)
 	#demoralizing_shout,if=incoming_damage_2500ms>health.max*0.1&!(debuff.demoralizing_shout.up|buff.ravager.up|buff.shield_wall.up|buff.last_stand.up|buff.enraged_regeneration.up|buff.shield_block.up|buff.potion.up)
 	if IncomingDamage(2.5) > MaxHealth() * 0.1 and not { target.DebuffPresent(demoralizing_shout_debuff) or BuffPresent(ravager_buff) or BuffPresent(shield_wall_buff) or BuffPresent(last_stand_buff) or BuffPresent(enraged_regeneration_buff) or BuffPresent(shield_block_buff) or BuffPresent(potion_armor_buff) } Spell(demoralizing_shout)
-	# CHANGE: Only suggest Enraged Regeneration at below 80% health.
 	#enraged_regeneration,if=incoming_damage_2500ms>health.max*0.1&!(debuff.demoralizing_shout.up|buff.ravager.up|buff.shield_wall.up|buff.last_stand.up|buff.enraged_regeneration.up|buff.shield_block.up|buff.potion.up)
-	#if IncomingDamage(2.5) > MaxHealth() * 0.1 and not { target.DebuffPresent(demoralizing_shout_debuff) or BuffPresent(ravager_buff) or BuffPresent(shield_wall_buff) or BuffPresent(last_stand_buff) or BuffPresent(enraged_regeneration_buff) or BuffPresent(shield_block_buff) or BuffPresent(potion_armor_buff) } Spell(enraged_regeneration)
-	if HealthPercent() < 80 and IncomingDamage(2.5) > MaxHealth() * 0.1 and not { target.DebuffPresent(demoralizing_shout_debuff) or BuffPresent(ravager_buff) or BuffPresent(shield_wall_buff) or BuffPresent(last_stand_buff) or BuffPresent(enraged_regeneration_buff) or BuffPresent(shield_block_buff) or BuffPresent(potion_armor_buff) } Spell(enraged_regeneration)
+	if IncomingDamage(2.5) > MaxHealth() * 0.1 and not { target.DebuffPresent(demoralizing_shout_debuff) or BuffPresent(ravager_buff) or BuffPresent(shield_wall_buff) or BuffPresent(last_stand_buff) or BuffPresent(enraged_regeneration_buff) or BuffPresent(shield_block_buff) or BuffPresent(potion_armor_buff) } and HealthPercent() < 80 Spell(enraged_regeneration)
 	#call_action_list,name=prot_aoe,if=active_enemies>3
 	if Enemies() > 3 ProtectionProtAoeShortCdActions()
+	# CHANGE: Get within melee range of the target.
+	GetInMeleeRange()
 	#heroic_strike,if=buff.ultimatum.up|(talent.unyielding_strikes.enabled&buff.unyielding_strikes.stack>=6)
 	if BuffPresent(ultimatum_buff) or Talent(unyielding_strikes_talent) and BuffStacks(unyielding_strikes_buff) >= 6 Spell(heroic_strike)

-	unless Spell(shield_slam)
-		or Spell(revenge)
+	unless Spell(shield_slam) or Spell(revenge)
 	{
 		#ravager
 		Spell(ravager)
@@ -1121,167 +1183,68 @@ AddFunction ProtectionProtCdActions
 	if Talent(avatar_talent) and { not SpellCooldown(ravager) > 0 and Talent(ravager_talent) or not SpellCooldown(dragon_roar) > 0 and Talent(dragon_roar_talent) or Talent(storm_bolt_talent) and not SpellCooldown(storm_bolt) > 0 or not { Talent(dragon_roar_talent) or Talent(ravager_talent) or Talent(storm_bolt_talent) } } Spell(avatar)
 }

-# Based on SimulationCraft profile "Warrior_Gladiator_T17M".
-#	class=warrior
-#	spec=protection
-#	talents=1133323
-#	glyphs=unending_rage/heroic_leap/cleave
-
-# ActionList: ProtectionGladiatorDefaultActions --> main, shortcd, cd
-
-AddFunction ProtectionGladiatorDefaultActions
-{
-	#auto_attack
-	#call_action_list,name=single,if=active_enemies=1
-	if Enemies() == 1 ProtectionGladiatorSingleActions()
-	#call_action_list,name=aoe,if=active_enemies>=2
-	if Enemies() >= 2 ProtectionGladiatorAoeActions()
-}
-
-AddFunction ProtectionGladiatorDefaultShortCdActions
-{
-	#charge
-	if target.InRange(charge) Spell(charge)
-	#shield_charge,if=(!buff.shield_charge.up&!cooldown.shield_slam.remains)|charges=2
-	if not BuffPresent(shield_charge_buff) and not SpellCooldown(shield_slam) > 0 or Charges(shield_charge) == 2 Spell(shield_charge)
-	#berserker_rage,if=buff.enrage.down
-	if BuffExpires(enrage_buff any=1) Spell(berserker_rage)
-	#heroic_leap,if=(raid_event.movement.distance>25&raid_event.movement.in>45)|!raid_event.movement.exists
-	if { 0 > 25 and 600 > 45 or not False(raid_event_movement_exists) } and target.InRange(charge) Spell(heroic_leap)
-	# CHANGE: Get within melee range of the target.
-	GetInMeleeRange()
-	#heroic_strike,if=(buff.shield_charge.up|(buff.unyielding_strikes.up&rage>=50-buff.unyielding_strikes.stack*5))&target.health.pct>20
-	if { BuffPresent(shield_charge_buff) or BuffPresent(unyielding_strikes_buff) and Rage() >= 50 - BuffStacks(unyielding_strikes_buff) * 5 } and target.HealthPercent() > 20 Spell(heroic_strike)
-	#heroic_strike,if=buff.ultimatum.up|rage>=rage.max-20|buff.unyielding_strikes.stack>4|target.time_to_die<10
-	if BuffPresent(ultimatum_buff) or Rage() >= MaxRage() - 20 or BuffStacks(unyielding_strikes_buff) > 4 or target.TimeToDie() < 10 Spell(heroic_strike)
-	#call_action_list,name=single,if=active_enemies=1
-	if Enemies() == 1 ProtectionGladiatorSingleShortCdActions()
-	#call_action_list,name=aoe,if=active_enemies>=2
-	if Enemies() >= 2 ProtectionGladiatorAoeShortCdActions()
-}
+### actions.prot_aoe

-AddFunction ProtectionGladiatorDefaultCdActions
-{
-	# CHANGE: Add interrupt actions missing from SimulationCraft action list.
-	InterruptActions()
-	#avatar
-	Spell(avatar)
-	#bloodbath
-	Spell(bloodbath)
-	#blood_fury,if=buff.bloodbath.up|buff.avatar.up|buff.shield_charge.up|target.time_to_die<10
-	if BuffPresent(bloodbath_buff) or BuffPresent(avatar_buff) or BuffPresent(shield_charge_buff) or target.TimeToDie() < 10 Spell(blood_fury_ap)
-	#berserking,if=buff.bloodbath.up|buff.avatar.up|buff.shield_charge.up|target.time_to_die<10
-	if BuffPresent(bloodbath_buff) or BuffPresent(avatar_buff) or BuffPresent(shield_charge_buff) or target.TimeToDie() < 10 Spell(berserking)
-	#arcane_torrent,if=rage<rage.max-40
-	if Rage() < MaxRage() - 40 Spell(arcane_torrent_rage)
-	#potion,name=draenic_armor,if=buff.bloodbath.up|buff.avatar.up|buff.shield_charge.up
-	if BuffPresent(bloodbath_buff) or BuffPresent(avatar_buff) or BuffPresent(shield_charge_buff) UsePotionArmor()
-	#call_action_list,name=single,if=active_enemies=1
-	if Enemies() == 1 ProtectionGladiatorSingleCdActions()
-	#call_action_list,name=aoe,if=active_enemies>=2
-	if Enemies() >= 2 ProtectionGladiatorAoeCdActions()
-}
-
-# ActionList: ProtectionGladiatorAoeActions --> main, shortcd, cd
-
-AddFunction ProtectionGladiatorAoeActions
+AddFunction ProtectionProtAoeMainActions
 {
+	#thunder_clap,if=!dot.deep_wounds.ticking
+	if not target.DebuffPresent(deep_wounds_debuff) Spell(thunder_clap)
+	#shield_slam,if=buff.shield_block.up
+	if BuffPresent(shield_block_buff) Spell(shield_slam)
 	#revenge
 	Spell(revenge)
+	#thunder_clap
+	Spell(thunder_clap)
+	#shield_slam
+	Spell(shield_slam)
 	#shield_slam
 	Spell(shield_slam)
-	#thunder_clap,cycle_targets=1,if=dot.deep_wounds.remains<3&active_enemies>4
-	if target.DebuffRemaining(deep_wounds_debuff) < 3 and Enemies() > 4 Spell(thunder_clap)
 	#execute,if=buff.sudden_death.react
 	if BuffPresent(sudden_death_buff) Spell(execute)
-	#thunder_clap,if=active_enemies>6
-	if Enemies() > 6 Spell(thunder_clap)
-	#devastate,cycle_targets=1,if=dot.deep_wounds.remains<5&cooldown.shield_slam.remains>execute_time*0.4
-	if target.DebuffRemaining(deep_wounds_debuff) < 5 and SpellCooldown(shield_slam) > ExecuteTime(devastate) * 0.4 Spell(devastate)
-	#devastate,if=cooldown.shield_slam.remains>execute_time*0.4
-	if SpellCooldown(shield_slam) > ExecuteTime(devastate) * 0.4 Spell(devastate)
+	#devastate
+	Spell(devastate)
 }

-AddFunction ProtectionGladiatorAoeShortCdActions
+AddFunction ProtectionProtAoeShortCdActions
 {
-	unless Spell(revenge)
-		or Spell(shield_slam)
+	unless not target.DebuffPresent(deep_wounds_debuff) and Spell(thunder_clap)
 	{
-		#dragon_roar,if=(buff.bloodbath.up|cooldown.bloodbath.remains>10)|!talent.bloodbath.enabled
-		if BuffPresent(bloodbath_buff) or SpellCooldown(bloodbath) > 10 or not Talent(bloodbath_talent) Spell(dragon_roar)
-		#storm_bolt,if=(buff.bloodbath.up|cooldown.bloodbath.remains>7)|!talent.bloodbath.enabled
-		if BuffPresent(bloodbath_buff) or SpellCooldown(bloodbath) > 7 or not Talent(bloodbath_talent) Spell(storm_bolt)
+		#heroic_strike,if=buff.ultimatum.up|rage>110|(talent.unyielding_strikes.enabled&buff.unyielding_strikes.stack>=6)
+		if BuffPresent(ultimatum_buff) or Rage() > 110 or Talent(unyielding_strikes_talent) and BuffStacks(unyielding_strikes_buff) >= 6 Spell(heroic_strike)
+		#heroic_leap,if=(raid_event.movement.distance>25&raid_event.movement.in>45)|!raid_event.movement.exists
+		if { 0 > 25 and 600 > 45 or not False(raid_event_movement_exists) } and target.InRange(charge) Spell(heroic_leap)

-		unless target.DebuffRemaining(deep_wounds_debuff) < 3 and Enemies() > 4 and Spell(thunder_clap)
+		unless BuffPresent(shield_block_buff) and Spell(shield_slam)
 		{
-			#bladestorm,if=buff.shield_charge.down
-			if BuffExpires(shield_charge_buff) Spell(bladestorm)
-		}
-	}
-}
-
-AddFunction ProtectionGladiatorAoeCdActions {}
-
-# ActionList: ProtectionGladiatorPrecombatActions --> main, shortcd, cd
-
-AddFunction ProtectionGladiatorPrecombatActions
-{
-	#flask,type=greater_draenic_strength_flask
-	#food,type=blackrock_barbecue
-	#stance,choose=gladiator
-	Spell(gladiator_stance)
-	# CHANGE: Apply raid buffs.
-	if not BuffPresent(attack_power_multiplier_buff any=1) Spell(battle_shout)
-	if not BuffPresent(stamina_buff any=1) and not BuffPresent(attack_power_multiplier_buff) Spell(commanding_shout)
-	#snapshot_stats
-}
+			#ravager,if=(buff.avatar.up|cooldown.avatar.remains>10)|!talent.avatar.enabled
+			if BuffPresent(avatar_buff) or SpellCooldown(avatar) > 10 or not Talent(avatar_talent) Spell(ravager)
+			#dragon_roar,if=(buff.bloodbath.up|cooldown.bloodbath.remains>10)|!talent.bloodbath.enabled
+			if BuffPresent(bloodbath_buff) or SpellCooldown(bloodbath) > 10 or not Talent(bloodbath_talent) Spell(dragon_roar)
+			#shockwave
+			Spell(shockwave)

-AddFunction ProtectionGladiatorPrecombatShortCdActions {}
+			unless Spell(revenge) or Spell(thunder_clap)
+			{
+				#bladestorm
+				Spell(bladestorm)

-AddFunction ProtectionGladiatorPrecombatCdActions
-{
-	unless Spell(gladiator_stance)
-		or not BuffPresent(attack_power_multiplier_buff any=1) and not BuffPresent(stamina_buff) and Spell(battle_shout)
-		or not BuffPresent(stamina_buff any=1) and Spell(commanding_shout)
-	{
-		#potion,name=draenic_armor
-		UsePotionArmor()
+				unless Spell(shield_slam)
+				{
+					#storm_bolt
+					Spell(storm_bolt)
+				}
+			}
+		}
 	}
 }

-# ActionList: ProtectionGladiatorSingleActions --> main, shortcd, cd
-
-AddFunction ProtectionGladiatorSingleActions
-{
-	#devastate,if=buff.unyielding_strikes.stack>0&buff.unyielding_strikes.stack<6&buff.unyielding_strikes.remains<1.5
-	if BuffStacks(unyielding_strikes_buff) > 0 and BuffStacks(unyielding_strikes_buff) < 6 and BuffRemaining(unyielding_strikes_buff) < 1.5 Spell(devastate)
-	#shield_slam
-	Spell(shield_slam)
-	#revenge
-	Spell(revenge)
-	#execute,if=buff.sudden_death.react
-	if BuffPresent(sudden_death_buff) Spell(execute)
-	#execute,if=rage>60&target.health.pct<20
-	if Rage() > 60 and target.HealthPercent() < 20 Spell(execute)
-	#devastate
-	Spell(devastate)
-}
-
-AddFunction ProtectionGladiatorSingleShortCdActions
+AddFunction ProtectionProtAoeCdActions
 {
-	unless BuffStacks(unyielding_strikes_buff) > 0 and BuffStacks(unyielding_strikes_buff) < 6 and BuffRemaining(unyielding_strikes_buff) < 1.5 and Spell(devastate)
-		or Spell(shield_slam)
-		or Spell(revenge)
-		or BuffPresent(sudden_death_buff) and Spell(execute)
-	{
-		#storm_bolt
-		Spell(storm_bolt)
-		#dragon_roar
-		Spell(dragon_roar)
-	}
+	#bloodbath
+	Spell(bloodbath)
+	#avatar
+	Spell(avatar)
 }
-
-AddFunction ProtectionGladiatorSingleCdActions {}
 ]]
 	OvaleScripts:RegisterScript("WARRIOR", name, desc, code, "include")
 end
@@ -1300,37 +1263,35 @@ AddCheckBox(opt_warrior_arms_aoe L(AOE) specialization=arms default)

 AddIcon specialization=arms help=shortcd enemies=1 checkbox=!opt_warrior_arms_aoe
 {
-	if InCombat(no) ArmsPrecombatShortCdActions()
 	ArmsDefaultShortCdActions()
 }

 AddIcon specialization=arms help=shortcd checkbox=opt_warrior_arms_aoe
 {
-	if InCombat(no) ArmsPrecombatShortCdActions()
 	ArmsDefaultShortCdActions()
 }

 AddIcon specialization=arms help=main enemies=1
 {
-	if InCombat(no) ArmsPrecombatActions()
-	ArmsDefaultActions()
+	if not InCombat() ArmsPrecombatMainActions()
+	ArmsDefaultMainActions()
 }

 AddIcon specialization=arms help=aoe checkbox=opt_warrior_arms_aoe
 {
-	if InCombat(no) ArmsPrecombatActions()
-	ArmsDefaultActions()
+	if not InCombat() ArmsPrecombatMainActions()
+	ArmsDefaultMainActions()
 }

 AddIcon specialization=arms help=cd enemies=1 checkbox=!opt_warrior_arms_aoe
 {
-	if InCombat(no) ArmsPrecombatCdActions()
+	if not InCombat() ArmsPrecombatCdActions()
 	ArmsDefaultCdActions()
 }

 AddIcon specialization=arms help=cd checkbox=opt_warrior_arms_aoe
 {
-	if InCombat(no) ArmsPrecombatCdActions()
+	if not InCombat() ArmsPrecombatCdActions()
 	ArmsDefaultCdActions()
 }

@@ -1341,12 +1302,10 @@ AddIcon specialization=fury help=shortcd enemies=1 checkbox=!opt_warrior_fury_ao
 {
 	if HasWeapon(main type=one_handed)
 	{
-		if InCombat(no) FurySingleMindedFuryPrecombatShortCdActions()
 		FurySingleMindedFuryDefaultShortCdActions()
 	}
 	if HasWeapon(main type=two_handed)
 	{
-		if InCombat(no) FuryTitansGripPrecombatShortCdActions()
 		FuryTitansGripDefaultShortCdActions()
 	}
 }
@@ -1355,12 +1314,10 @@ AddIcon specialization=fury help=shortcd checkbox=opt_warrior_fury_aoe
 {
 	if HasWeapon(main type=one_handed)
 	{
-		if InCombat(no) FurySingleMindedFuryPrecombatShortCdActions()
 		FurySingleMindedFuryDefaultShortCdActions()
 	}
 	if HasWeapon(main type=two_handed)
 	{
-		if InCombat(no) FuryTitansGripPrecombatShortCdActions()
 		FuryTitansGripDefaultShortCdActions()
 	}
 }
@@ -1369,13 +1326,13 @@ AddIcon specialization=fury help=main enemies=1
 {
 	if HasWeapon(main type=one_handed)
 	{
-		if InCombat(no) FurySingleMindedFuryPrecombatActions()
-		FurySingleMindedFuryDefaultActions()
+		if not InCombat() FurySingleMindedFuryPrecombatMainActions()
+		FurySingleMindedFuryDefaultMainActions()
 	}
 	if HasWeapon(main type=two_handed)
 	{
-		if InCombat(no) FuryTitansGripPrecombatActions()
-		FuryTitansGripDefaultActions()
+		if not InCombat() FuryTitansGripPrecombatMainActions()
+		FuryTitansGripDefaultMainActions()
 	}
 }

@@ -1383,13 +1340,13 @@ AddIcon specialization=fury help=aoe checkbox=opt_warrior_fury_aoe
 {
 	if HasWeapon(main type=one_handed)
 	{
-		if InCombat(no) FurySingleMindedFuryPrecombatActions()
-		FurySingleMindedFuryDefaultActions()
+		if not InCombat() FurySingleMindedFuryPrecombatMainActions()
+		FurySingleMindedFuryDefaultMainActions()
 	}
 	if HasWeapon(main type=two_handed)
 	{
-		if InCombat(no) FuryTitansGripPrecombatActions()
-		FuryTitansGripDefaultActions()
+		if not InCombat() FuryTitansGripPrecombatMainActions()
+		FuryTitansGripDefaultMainActions()
 	}
 }

@@ -1397,12 +1354,12 @@ AddIcon specialization=fury help=cd enemies=1 checkbox=!opt_warrior_fury_aoe
 {
 	if HasWeapon(main type=one_handed)
 	{
-		if InCombat(no) FurySingleMindedFuryPrecombatCdActions()
+		if not InCombat() FurySingleMindedFuryPrecombatCdActions()
 		FurySingleMindedFuryDefaultCdActions()
 	}
 	if HasWeapon(main type=two_handed)
 	{
-		if InCombat(no) FuryTitansGripPrecombatCdActions()
+		if not InCombat() FuryTitansGripPrecombatCdActions()
 		FuryTitansGripDefaultCdActions()
 	}
 }
@@ -1411,12 +1368,12 @@ AddIcon specialization=fury help=cd checkbox=opt_warrior_fury_aoe
 {
 	if HasWeapon(main type=one_handed)
 	{
-		if InCombat(no) FurySingleMindedFuryPrecombatCdActions()
+		if not InCombat() FurySingleMindedFuryPrecombatCdActions()
 		FurySingleMindedFuryDefaultCdActions()
 	}
 	if HasWeapon(main type=two_handed)
 	{
-		if InCombat(no) FuryTitansGripPrecombatCdActions()
+		if not InCombat() FuryTitansGripPrecombatCdActions()
 		FuryTitansGripDefaultCdActions()
 	}
 }
@@ -1428,12 +1385,10 @@ AddIcon specialization=protection help=shortcd enemies=1 checkbox=!opt_warrior_p
 {
 	if Talent(gladiators_resolve_talent) and Stance(warrior_gladiator_stance)
 	{
-		if InCombat(no) ProtectionGladiatorPrecombatShortCdActions()
 		ProtectionGladiatorDefaultShortCdActions()
 	}
 	unless Talent(gladiators_resolve_talent) and Stance(warrior_gladiator_stance)
 	{
-		if InCombat(no) ProtectionPrecombatShortCdActions()
 		ProtectionDefaultShortCdActions()
 	}
 }
@@ -1442,12 +1397,10 @@ AddIcon specialization=protection help=shortcd checkbox=opt_warrior_protection_a
 {
 	if Talent(gladiators_resolve_talent) and Stance(warrior_gladiator_stance)
 	{
-		if InCombat(no) ProtectionGladiatorPrecombatShortCdActions()
 		ProtectionGladiatorDefaultShortCdActions()
 	}
 	unless Talent(gladiators_resolve_talent) and Stance(warrior_gladiator_stance)
 	{
-		if InCombat(no) ProtectionPrecombatShortCdActions()
 		ProtectionDefaultShortCdActions()
 	}
 }
@@ -1456,13 +1409,13 @@ AddIcon specialization=protection help=main enemies=1
 {
 	if Talent(gladiators_resolve_talent) and Stance(warrior_gladiator_stance)
 	{
-		if InCombat(no) ProtectionGladiatorPrecombatActions()
-		ProtectionGladiatorDefaultActions()
+		if not InCombat() ProtectionGladiatorPrecombatMainActions()
+		ProtectionGladiatorDefaultMainActions()
 	}
 	unless Talent(gladiators_resolve_talent) and Stance(warrior_gladiator_stance)
 	{
-		if InCombat(no) ProtectionPrecombatActions()
-		ProtectionDefaultActions()
+		if not InCombat() ProtectionPrecombatMainActions()
+		ProtectionDefaultMainActions()
 	}
 }

@@ -1470,13 +1423,13 @@ AddIcon specialization=protection help=aoe checkbox=opt_warrior_protection_aoe
 {
 	if Talent(gladiators_resolve_talent) and Stance(warrior_gladiator_stance)
 	{
-		if InCombat(no) ProtectionGladiatorPrecombatActions()
-		ProtectionGladiatorDefaultActions()
+		if not InCombat() ProtectionGladiatorPrecombatMainActions()
+		ProtectionGladiatorDefaultMainActions()
 	}
 	unless Talent(gladiators_resolve_talent) and Stance(warrior_gladiator_stance)
 	{
-		if InCombat(no) ProtectionPrecombatActions()
-		ProtectionDefaultActions()
+		if not InCombat() ProtectionPrecombatMainActions()
+		ProtectionDefaultMainActions()
 	}
 }

@@ -1484,12 +1437,12 @@ AddIcon specialization=protection help=cd enemies=1 checkbox=!opt_warrior_protec
 {
 	if Talent(gladiators_resolve_talent) and Stance(warrior_gladiator_stance)
 	{
-		if InCombat(no) ProtectionGladiatorPrecombatCdActions()
+		if not InCombat() ProtectionGladiatorPrecombatCdActions()
 		ProtectionGladiatorDefaultCdActions()
 	}
 	unless Talent(gladiators_resolve_talent) and Stance(warrior_gladiator_stance)
 	{
-		if InCombat(no) ProtectionPrecombatCdActions()
+		if not InCombat() ProtectionPrecombatCdActions()
 		ProtectionDefaultCdActions()
 	}
 }
@@ -1498,12 +1451,12 @@ AddIcon specialization=protection help=cd checkbox=opt_warrior_protection_aoe
 {
 	if Talent(gladiators_resolve_talent) and Stance(warrior_gladiator_stance)
 	{
-		if InCombat(no) ProtectionGladiatorPrecombatCdActions()
+		if not InCombat() ProtectionGladiatorPrecombatCdActions()
 		ProtectionGladiatorDefaultCdActions()
 	}
 	unless Talent(gladiators_resolve_talent) and Stance(warrior_gladiator_stance)
 	{
-		if InCombat(no) ProtectionPrecombatCdActions()
+		if not InCombat() ProtectionPrecombatCdActions()
 		ProtectionDefaultCdActions()
 	}
 }