Quantcast

Regenerate reference scripts from SimC git master from 2014-12-28.

Johnny C. Lam [12-28-14 - 03:10]
Regenerate reference scripts from SimC git master from 2014-12-28.

These SimulationCraft reference scripts are generated using the latest
translator using tagged spells and 4-icon layout and are now very close to
the default Ovale scripts.
Filename
scripts/simulationcraft_deathknight_blood.lua
scripts/simulationcraft_deathknight_frost_1h.lua
scripts/simulationcraft_deathknight_frost_2h.lua
scripts/simulationcraft_deathknight_unholy.lua
scripts/simulationcraft_druid_balance.lua
scripts/simulationcraft_druid_feral.lua
scripts/simulationcraft_druid_guardian.lua
scripts/simulationcraft_hunter_bm.lua
scripts/simulationcraft_hunter_mm.lua
scripts/simulationcraft_hunter_sv.lua
scripts/simulationcraft_mage_arcane.lua
scripts/simulationcraft_mage_fire.lua
scripts/simulationcraft_mage_frost.lua
scripts/simulationcraft_monk_brewmaster_1h_ce.lua
scripts/simulationcraft_monk_brewmaster_1h_serenity.lua
scripts/simulationcraft_monk_brewmaster_2h_ce.lua
scripts/simulationcraft_monk_brewmaster_2h_serenity.lua
scripts/simulationcraft_monk_windwalker_1h.lua
scripts/simulationcraft_monk_windwalker_2h.lua
scripts/simulationcraft_paladin_holy.lua
scripts/simulationcraft_paladin_protection.lua
scripts/simulationcraft_paladin_retribution.lua
scripts/simulationcraft_priest_discipline_dmg.lua
scripts/simulationcraft_priest_discipline_heal.lua
scripts/simulationcraft_priest_holy_dmg.lua
scripts/simulationcraft_priest_holy_heal.lua
scripts/simulationcraft_priest_shadow_as.lua
scripts/simulationcraft_priest_shadow_cop.lua
scripts/simulationcraft_priest_shadow_ve.lua
scripts/simulationcraft_rogue_assassination.lua
scripts/simulationcraft_rogue_combat.lua
scripts/simulationcraft_rogue_subtlety.lua
scripts/simulationcraft_shaman_elemental.lua
scripts/simulationcraft_shaman_enhancement.lua
scripts/simulationcraft_warlock_affliction.lua
scripts/simulationcraft_warlock_demonology.lua
scripts/simulationcraft_warlock_destruction.lua
scripts/simulationcraft_warrior_arms.lua
scripts/simulationcraft_warrior_fury_1h.lua
scripts/simulationcraft_warrior_fury_2h.lua
scripts/simulationcraft_warrior_gladiator.lua
scripts/simulationcraft_warrior_protection.lua
diff --git a/scripts/simulationcraft_deathknight_blood.lua b/scripts/simulationcraft_deathknight_blood.lua
index a555294..4ff69a7 100644
--- a/scripts/simulationcraft_deathknight_blood.lua
+++ b/scripts/simulationcraft_deathknight_blood.lua
@@ -36,39 +36,14 @@ AddFunction InterruptActions
 	}
 }

-AddFunction BloodDefaultActions
+### actions.default
+
+AddFunction BloodDefaultMainActions
 {
-	#auto_attack
-	#blood_fury
-	Spell(blood_fury_ap)
-	#berserking
-	Spell(berserking)
-	#arcane_torrent
-	Spell(arcane_torrent_runicpower)
-	#potion,name=draenic_armor,if=buff.potion.down&buff.blood_shield.down&!unholy&!frost
-	if BuffExpires(potion_armor_buff) and BuffExpires(blood_shield_buff) and not Rune(unholy) >= 1 and not Rune(frost) >= 1 UsePotionArmor()
-	#antimagic_shell
-	if IncomingDamage(1.5) > 0 Spell(antimagic_shell)
 	#conversion,if=!buff.conversion.up&runic_power>50&health.pct<90
 	if not BuffPresent(conversion_buff) and RunicPower() > 50 and HealthPercent() < 90 Spell(conversion)
-	#lichborne,if=health.pct<90
-	if HealthPercent() < 90 Spell(lichborne)
 	#death_strike,if=incoming_damage_5s>=health.max*0.65
 	if IncomingDamage(5) >= MaxHealth() * 0.65 Spell(death_strike)
-	#army_of_the_dead,if=buff.bone_shield.down&buff.dancing_rune_weapon.down&buff.icebound_fortitude.down&buff.vampiric_blood.down
-	if BuffExpires(bone_shield_buff) and BuffExpires(dancing_rune_weapon_buff) and BuffExpires(icebound_fortitude_buff) and BuffExpires(vampiric_blood_buff) Spell(army_of_the_dead)
-	#bone_shield,if=buff.army_of_the_dead.down&buff.bone_shield.down&buff.dancing_rune_weapon.down&buff.icebound_fortitude.down&buff.vampiric_blood.down
-	if BuffExpires(army_of_the_dead_buff) and BuffExpires(bone_shield_buff) and BuffExpires(dancing_rune_weapon_buff) and BuffExpires(icebound_fortitude_buff) and BuffExpires(vampiric_blood_buff) Spell(bone_shield)
-	#vampiric_blood,if=health.pct<50
-	if HealthPercent() < 50 Spell(vampiric_blood)
-	#icebound_fortitude,if=health.pct<30&buff.army_of_the_dead.down&buff.dancing_rune_weapon.down&buff.bone_shield.down&buff.vampiric_blood.down
-	if HealthPercent() < 30 and BuffExpires(army_of_the_dead_buff) and BuffExpires(dancing_rune_weapon_buff) and BuffExpires(bone_shield_buff) and BuffExpires(vampiric_blood_buff) Spell(icebound_fortitude)
-	#rune_tap,if=health.pct<50&buff.army_of_the_dead.down&buff.dancing_rune_weapon.down&buff.bone_shield.down&buff.vampiric_blood.down&buff.icebound_fortitude.down
-	if HealthPercent() < 50 and BuffExpires(army_of_the_dead_buff) and BuffExpires(dancing_rune_weapon_buff) and BuffExpires(bone_shield_buff) and BuffExpires(vampiric_blood_buff) and BuffExpires(icebound_fortitude_buff) Spell(rune_tap)
-	#dancing_rune_weapon,if=health.pct<80&buff.army_of_the_dead.down&buff.icebound_fortitude.down&buff.bone_shield.down&buff.vampiric_blood.down
-	if HealthPercent() < 80 and BuffExpires(army_of_the_dead_buff) and BuffExpires(icebound_fortitude_buff) and BuffExpires(bone_shield_buff) and BuffExpires(vampiric_blood_buff) Spell(dancing_rune_weapon)
-	#death_pact,if=health.pct<50
-	if HealthPercent() < 50 Spell(death_pact)
 	#outbreak,if=(!talent.necrotic_plague.enabled&disease.min_remains<8)|!disease.ticking
 	if not Talent(necrotic_plague_talent) and target.DiseasesRemaining() < 8 or not target.DiseasesAnyTicking() Spell(outbreak)
 	#death_coil,if=runic_power>90
@@ -77,8 +52,6 @@ AddFunction BloodDefaultActions
 	if not Talent(necrotic_plague_talent) and not target.DebuffPresent(blood_plague_debuff) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) Spell(plague_strike)
 	#icy_touch,if=(!talent.necrotic_plague.enabled&!dot.frost_fever.ticking)|(talent.necrotic_plague.enabled&!dot.necrotic_plague.ticking)
 	if not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) Spell(icy_touch)
-	#defile
-	Spell(defile)
 	#death_strike,if=(unholy=2|frost=2)
 	if Rune(unholy) >= 2 or Rune(frost) >= 2 Spell(death_strike)
 	#death_coil,if=runic_power>70
@@ -87,15 +60,78 @@ AddFunction BloodDefaultActions
 	if target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and Rune(blood) >= 1 Spell(soul_reaper_blood)
 	#blood_boil,if=blood=2
 	if Rune(blood) >= 2 Spell(blood_boil)
-	#blood_tap
-	if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 	#death_coil
 	Spell(death_coil)
-	#empower_rune_weapon,if=!blood&!unholy&!frost
-	if not Rune(blood) >= 1 and not Rune(unholy) >= 1 and not Rune(frost) >= 1 Spell(empower_rune_weapon)
 }

-AddFunction BloodPrecombatActions
+AddFunction BloodDefaultShortCdActions
+{
+	#antimagic_shell
+	if IncomingDamage(1.5) > 0 Spell(antimagic_shell)
+
+	unless not BuffPresent(conversion_buff) and RunicPower() > 50 and HealthPercent() < 90 and Spell(conversion) or IncomingDamage(5) >= MaxHealth() * 0.65 and Spell(death_strike)
+	{
+		#bone_shield,if=buff.army_of_the_dead.down&buff.bone_shield.down&buff.dancing_rune_weapon.down&buff.icebound_fortitude.down&buff.vampiric_blood.down
+		if BuffExpires(army_of_the_dead_buff) and BuffExpires(bone_shield_buff) and BuffExpires(dancing_rune_weapon_buff) and BuffExpires(icebound_fortitude_buff) and BuffExpires(vampiric_blood_buff) Spell(bone_shield)
+		#vampiric_blood,if=health.pct<50
+		if HealthPercent() < 50 Spell(vampiric_blood)
+		#rune_tap,if=health.pct<50&buff.army_of_the_dead.down&buff.dancing_rune_weapon.down&buff.bone_shield.down&buff.vampiric_blood.down&buff.icebound_fortitude.down
+		if HealthPercent() < 50 and BuffExpires(army_of_the_dead_buff) and BuffExpires(dancing_rune_weapon_buff) and BuffExpires(bone_shield_buff) and BuffExpires(vampiric_blood_buff) and BuffExpires(icebound_fortitude_buff) Spell(rune_tap)
+		#dancing_rune_weapon,if=health.pct<80&buff.army_of_the_dead.down&buff.icebound_fortitude.down&buff.bone_shield.down&buff.vampiric_blood.down
+		if HealthPercent() < 80 and BuffExpires(army_of_the_dead_buff) and BuffExpires(icebound_fortitude_buff) and BuffExpires(bone_shield_buff) and BuffExpires(vampiric_blood_buff) Spell(dancing_rune_weapon)
+
+		unless { not Talent(necrotic_plague_talent) and target.DiseasesRemaining() < 8 or not target.DiseasesAnyTicking() } and Spell(outbreak) or RunicPower() > 90 and Spell(death_coil) or { not Talent(necrotic_plague_talent) and not target.DebuffPresent(blood_plague_debuff) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) } and Spell(plague_strike) or { not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) } and Spell(icy_touch)
+		{
+			#defile
+			Spell(defile)
+
+			unless { Rune(unholy) >= 2 or Rune(frost) >= 2 } and Spell(death_strike) or RunicPower() > 70 and Spell(death_coil) or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and Rune(blood) >= 1 and Spell(soul_reaper_blood) or Rune(blood) >= 2 and Spell(blood_boil)
+			{
+				#blood_tap
+				if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+			}
+		}
+	}
+}
+
+AddFunction BloodDefaultCdActions
+{
+	#auto_attack
+	#blood_fury
+	Spell(blood_fury_ap)
+	#berserking
+	Spell(berserking)
+	#arcane_torrent
+	Spell(arcane_torrent_runicpower)
+	#potion,name=draenic_armor,if=buff.potion.down&buff.blood_shield.down&!unholy&!frost
+	if BuffExpires(potion_armor_buff) and BuffExpires(blood_shield_buff) and not Rune(unholy) >= 1 and not Rune(frost) >= 1 UsePotionArmor()
+
+	unless not BuffPresent(conversion_buff) and RunicPower() > 50 and HealthPercent() < 90 and Spell(conversion)
+	{
+		#lichborne,if=health.pct<90
+		if HealthPercent() < 90 Spell(lichborne)
+
+		unless IncomingDamage(5) >= MaxHealth() * 0.65 and Spell(death_strike)
+		{
+			#army_of_the_dead,if=buff.bone_shield.down&buff.dancing_rune_weapon.down&buff.icebound_fortitude.down&buff.vampiric_blood.down
+			if BuffExpires(bone_shield_buff) and BuffExpires(dancing_rune_weapon_buff) and BuffExpires(icebound_fortitude_buff) and BuffExpires(vampiric_blood_buff) Spell(army_of_the_dead)
+			#icebound_fortitude,if=health.pct<30&buff.army_of_the_dead.down&buff.dancing_rune_weapon.down&buff.bone_shield.down&buff.vampiric_blood.down
+			if HealthPercent() < 30 and BuffExpires(army_of_the_dead_buff) and BuffExpires(dancing_rune_weapon_buff) and BuffExpires(bone_shield_buff) and BuffExpires(vampiric_blood_buff) Spell(icebound_fortitude)
+			#death_pact,if=health.pct<50
+			if HealthPercent() < 50 Spell(death_pact)
+
+			unless { not Talent(necrotic_plague_talent) and target.DiseasesRemaining() < 8 or not target.DiseasesAnyTicking() } and Spell(outbreak) or RunicPower() > 90 and Spell(death_coil) or { not Talent(necrotic_plague_talent) and not target.DebuffPresent(blood_plague_debuff) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) } and Spell(plague_strike) or { not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) or Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) } and Spell(icy_touch) or Spell(defile) or { Rune(unholy) >= 2 or Rune(frost) >= 2 } and Spell(death_strike) or RunicPower() > 70 and Spell(death_coil) or target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and Rune(blood) >= 1 and Spell(soul_reaper_blood) or Rune(blood) >= 2 and Spell(blood_boil) or Spell(death_coil)
+			{
+				#empower_rune_weapon,if=!blood&!unholy&!frost
+				if not Rune(blood) >= 1 and not Rune(unholy) >= 1 and not Rune(frost) >= 1 Spell(empower_rune_weapon)
+			}
+		}
+	}
+}
+
+### actions.precombat
+
+AddFunction BloodPrecombatMainActions
 {
 	#flask,type=greater_draenic_stamina_flask
 	#food,type=talador_surf_and_turf
@@ -103,23 +139,64 @@ AddFunction BloodPrecombatActions
 	Spell(blood_presence)
 	#horn_of_winter
 	if BuffExpires(attack_power_multiplier_buff any=1) Spell(horn_of_winter)
-	#snapshot_stats
-	#potion,name=draenic_armor
-	UsePotionArmor()
-	#bone_shield
-	Spell(bone_shield)
+}
+
+AddFunction BloodPrecombatShortCdActions
+{
+	unless Spell(blood_presence) or BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter)
+	{
+		#bone_shield
+		Spell(bone_shield)
+	}
+}
+
+AddFunction BloodPrecombatCdActions
+{
+	unless Spell(blood_presence) or BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter)
+	{
+		#snapshot_stats
+		#potion,name=draenic_armor
+		UsePotionArmor()
+	}
+}
+
+### Blood icons.
+AddCheckBox(opt_deathknight_blood_aoe L(AOE) specialization=blood default)
+
+AddIcon specialization=blood help=shortcd enemies=1 checkbox=!opt_deathknight_blood_aoe
+{
+	if not InCombat() BloodPrecombatShortCdActions()
+	BloodDefaultShortCdActions()
+}
+
+AddIcon specialization=blood help=shortcd checkbox=opt_deathknight_blood_aoe
+{
+	if not InCombat() BloodPrecombatShortCdActions()
+	BloodDefaultShortCdActions()
 }

 AddIcon specialization=blood help=main enemies=1
 {
-	if not InCombat() BloodPrecombatActions()
-	BloodDefaultActions()
+	if not InCombat() BloodPrecombatMainActions()
+	BloodDefaultMainActions()
+}
+
+AddIcon specialization=blood help=aoe checkbox=opt_deathknight_blood_aoe
+{
+	if not InCombat() BloodPrecombatMainActions()
+	BloodDefaultMainActions()
+}
+
+AddIcon specialization=blood help=cd enemies=1 checkbox=!opt_deathknight_blood_aoe
+{
+	if not InCombat() BloodPrecombatCdActions()
+	BloodDefaultCdActions()
 }

-AddIcon specialization=blood help=aoe
+AddIcon specialization=blood help=cd checkbox=opt_deathknight_blood_aoe
 {
-	if not InCombat() BloodPrecombatActions()
-	BloodDefaultActions()
+	if not InCombat() BloodPrecombatCdActions()
+	BloodDefaultCdActions()
 }

 ### Required symbols
@@ -159,7 +236,6 @@ AddIcon specialization=blood help=aoe
 # necrotic_plague_talent
 # outbreak
 # plague_strike
-# potion_armor_buff
 # quaking_palm
 # rune_tap
 # soul_reaper_blood
diff --git a/scripts/simulationcraft_deathknight_frost_1h.lua b/scripts/simulationcraft_deathknight_frost_1h.lua
index 92afcd1..3d2c87c 100644
--- a/scripts/simulationcraft_deathknight_frost_1h.lua
+++ b/scripts/simulationcraft_deathknight_frost_1h.lua
@@ -43,7 +43,17 @@ AddFunction InterruptActions
 	}
 }

-AddFunction FrostDualWieldDefaultActions
+### actions.default
+
+AddFunction FrostDualWieldDefaultMainActions
+{
+	#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
@@ -52,6 +62,14 @@ AddFunction FrostDualWieldDefaultActions
 	if IncomingDamage(1.5) > 0 Spell(antimagic_shell)
 	#pillar_of_frost
 	Spell(pillar_of_frost)
+	#run_action_list,name=aoe,if=active_enemies>=3
+	if Enemies() >= 3 FrostDualWieldAoeShortCdActions()
+	#run_action_list,name=single_target,if=active_enemies<3
+	if Enemies() < 3 FrostDualWieldSingleTargetShortCdActions()
+}
+
+AddFunction FrostDualWieldDefaultCdActions
+{
 	#potion,name=draenic_strength,if=target.time_to_die<=30|(target.time_to_die<=60&buff.pillar_of_frost.up)
 	if target.TimeToDie() <= 30 or target.TimeToDie() <= 60 and BuffPresent(pillar_of_frost_buff) UsePotionStrength()
 	#empower_rune_weapon,if=target.time_to_die<=60&buff.potion.up
@@ -65,86 +83,165 @@ AddFunction FrostDualWieldDefaultActions
 	#use_item,slot=trinket2
 	UseItemActions()
 	#run_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 FrostDualWieldAoeActions()
+	if Enemies() >= 3 FrostDualWieldAoeCdActions()
 	#run_action_list,name=single_target,if=active_enemies<3
-	if Enemies() < 3 FrostDualWieldSingleTargetActions()
+	if Enemies() < 3 FrostDualWieldSingleTargetCdActions()
 }

-AddFunction FrostDualWieldAoeActions
+### actions.aoe
+
+AddFunction FrostDualWieldAoeMainActions
 {
-	#unholy_blight
-	Spell(unholy_blight)
 	#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)
-	#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) FrostDualWieldBosAoeActions()
+	if BuffPresent(breath_of_sindragosa_buff) FrostDualWieldBosAoeMainActions()
 	#howling_blast
 	Spell(howling_blast)
-	#blood_tap,if=buff.blood_charge.stack>10
-	if BuffStacks(blood_charge_buff) > 10 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 	#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)
-	#blood_tap
-	if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 	#frost_strike,if=!talent.breath_of_sindragosa.enabled|cooldown.breath_of_sindragosa.remains>=10
 	if not Talent(breath_of_sindragosa_talent) or SpellCooldown(breath_of_sindragosa) >= 10 Spell(frost_strike)
 	#plague_leech
 	if target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
 	#plague_strike,if=unholy=1
 	if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(plague_strike)
-	#empower_rune_weapon
-	Spell(empower_rune_weapon)
 }

-AddFunction FrostDualWieldBosAoeActions
+AddFunction FrostDualWieldAoeShortCdActions
+{
+	#unholy_blight
+	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)
+	{
+		#defile
+		Spell(defile)
+		#run_action_list,name=bos_aoe,if=dot.breath_of_sindragosa.ticking
+		if BuffPresent(breath_of_sindragosa_buff) FrostDualWieldBosAoeShortCdActions()
+
+		unless Spell(howling_blast)
+		{
+			#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() > 88 and Spell(frost_strike)
+			{
+				#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)
+				}
+			}
+		}
+	}
+}
+
+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)
+	{
+		#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 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)
+		}
+	}
+}
+
+### actions.bos_aoe
+
+AddFunction FrostDualWieldBosAoeMainActions
 {
 	#howling_blast
 	Spell(howling_blast)
-	#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)
 	#plague_strike,if=unholy=2
 	if Rune(unholy) >= 2 Spell(plague_strike)
-	#blood_tap
-	if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 	#plague_leech
 	if target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
 	#plague_strike,if=unholy=1
 	if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(plague_strike)
-	#empower_rune_weapon
-	Spell(empower_rune_weapon)
 }

-AddFunction FrostDualWieldBosStActions
+AddFunction FrostDualWieldBosAoeShortCdActions
+{
+	unless Spell(howling_blast)
+	{
+		#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) >= 2 and Spell(plague_strike)
+		{
+			#blood_tap
+			if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+		}
+	}
+}
+
+AddFunction FrostDualWieldBosAoeCdActions
+{
+	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)
+	}
+}
+
+### actions.bos_st
+
+AddFunction FrostDualWieldBosStMainActions
 {
 	#obliterate,if=buff.killing_machine.react
 	if BuffPresent(killing_machine_buff) Spell(obliterate)
-	#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)
 	#plague_leech,if=buff.killing_machine.react
 	if BuffPresent(killing_machine_buff) and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
 	#howling_blast,if=runic_power<88
 	if RunicPower() < 88 Spell(howling_blast)
 	#obliterate,if=unholy>0&runic_power<76
 	if Rune(unholy) >= 1 and RunicPower() < 76 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)
 	#plague_leech
 	if target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
-	#empower_rune_weapon
-	Spell(empower_rune_weapon)
 }

-AddFunction FrostDualWieldPrecombatActions
+AddFunction FrostDualWieldBosStShortCdActions
+{
+	unless BuffPresent(killing_machine_buff) and Spell(obliterate)
+	{
+		#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 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)
+		}
+	}
+}
+
+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() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } and Spell(plague_leech)
+	{
+		#empower_rune_weapon
+		Spell(empower_rune_weapon)
+	}
+}
+
+### actions.precombat
+
+AddFunction FrostDualWieldPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=sleeper_surprise
@@ -152,31 +249,37 @@ AddFunction FrostDualWieldPrecombatActions
 	if BuffExpires(attack_power_multiplier_buff any=1) Spell(horn_of_winter)
 	#frost_presence
 	Spell(frost_presence)
-	#snapshot_stats
-	#army_of_the_dead
-	Spell(army_of_the_dead)
-	#potion,name=draenic_strength
-	UsePotionStrength()
-	#pillar_of_frost
-	Spell(pillar_of_frost)
 }

-AddFunction FrostDualWieldSingleTargetActions
+AddFunction FrostDualWieldPrecombatShortCdActions
+{
+	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter) or Spell(frost_presence)
+	{
+		#pillar_of_frost
+		Spell(pillar_of_frost)
+	}
+}
+
+AddFunction FrostDualWieldPrecombatCdActions
+{
+	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
+		UsePotionStrength()
+	}
+}
+
+### actions.single_target
+
+AddFunction FrostDualWieldSingleTargetMainActions
 {
-	#blood_tap,if=buff.blood_charge.stack>10&(runic_power>76|(runic_power>=20&buff.killing_machine.react))
-	if BuffStacks(blood_charge_buff) > 10 and { RunicPower() > 76 or RunicPower() >= 20 and BuffPresent(killing_machine_buff) } and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 	#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)
-	#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)
-	#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) FrostDualWieldBosStActions()
-	#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)
+	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
@@ -187,8 +290,6 @@ AddFunction FrostDualWieldSingleTargetActions
 	if SpellCooldown(antimagic_shell) < 1 and RunicPower() >= 50 and not BuffPresent(antimagic_shell_buff) Spell(frost_strike)
 	#howling_blast,if=death>1|frost>1
 	if Rune(death) >= 2 or Rune(frost) >= 2 Spell(howling_blast)
-	#unholy_blight,if=!disease.ticking
-	if not target.DiseasesAnyTicking() Spell(unholy_blight)
 	#howling_blast,if=!talent.necrotic_plague.enabled&!dot.frost_fever.ticking
 	if not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) Spell(howling_blast)
 	#howling_blast,if=talent.necrotic_plague.enabled&!dot.necrotic_plague.ticking
@@ -205,24 +306,94 @@ AddFunction FrostDualWieldSingleTargetActions
 	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
 	if not { target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and SpellCooldown(soul_reaper_frost) < 3 } or RuneCount(death) + RuneCount(frost) >= 2 Spell(howling_blast)
-	#blood_tap
-	if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 	#plague_leech
 	if target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
-	#empower_rune_weapon
-	Spell(empower_rune_weapon)
+}
+
+AddFunction FrostDualWieldSingleTargetShortCdActions
+{
+	#blood_tap,if=buff.blood_charge.stack>10&(runic_power>76|(runic_power>=20&buff.killing_machine.react))
+	if BuffStacks(blood_charge_buff) > 10 and { RunicPower() > 76 or RunicPower() >= 20 and BuffPresent(killing_machine_buff) } and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+
+	unless 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)
+		#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 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)
+			{
+				#blood_tap
+				if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+			}
+		}
+	}
+}
+
+AddFunction FrostDualWieldSingleTargetCdActions
+{
+	unless target.HealthPercent() - 3 * target.HealthPercent() / target.TimeToDie() <= 35 and Spell(soul_reaper_frost)
+	{
+		#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) 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)
+		{
+			#empower_rune_weapon
+			Spell(empower_rune_weapon)
+		}
+	}
+}
+
+### Frost icons.
+AddCheckBox(opt_deathknight_frost_aoe L(AOE) specialization=frost default)
+
+AddIcon specialization=frost help=shortcd enemies=1 checkbox=!opt_deathknight_frost_aoe
+{
+	if not InCombat() FrostDualWieldPrecombatShortCdActions()
+	FrostDualWieldDefaultShortCdActions()
+}
+
+AddIcon specialization=frost help=shortcd checkbox=opt_deathknight_frost_aoe
+{
+	if not InCombat() FrostDualWieldPrecombatShortCdActions()
+	FrostDualWieldDefaultShortCdActions()
 }

 AddIcon specialization=frost help=main enemies=1
 {
-	if not InCombat() FrostDualWieldPrecombatActions()
-	FrostDualWieldDefaultActions()
+	if not InCombat() FrostDualWieldPrecombatMainActions()
+	FrostDualWieldDefaultMainActions()
+}
+
+AddIcon specialization=frost help=aoe checkbox=opt_deathknight_frost_aoe
+{
+	if not InCombat() FrostDualWieldPrecombatMainActions()
+	FrostDualWieldDefaultMainActions()
+}
+
+AddIcon specialization=frost help=cd enemies=1 checkbox=!opt_deathknight_frost_aoe
+{
+	if not InCombat() FrostDualWieldPrecombatCdActions()
+	FrostDualWieldDefaultCdActions()
 }

-AddIcon specialization=frost help=aoe
+AddIcon specialization=frost help=cd checkbox=opt_deathknight_frost_aoe
 {
-	if not InCombat() FrostDualWieldPrecombatActions()
-	FrostDualWieldDefaultActions()
+	if not InCombat() FrostDualWieldPrecombatCdActions()
+	FrostDualWieldDefaultCdActions()
 }

 ### Required symbols
@@ -260,7 +431,6 @@ AddIcon specialization=frost help=aoe
 # pillar_of_frost_buff
 # plague_leech
 # plague_strike
-# potion_strength_buff
 # quaking_palm
 # rime_buff
 # soul_reaper_frost
diff --git a/scripts/simulationcraft_deathknight_frost_2h.lua b/scripts/simulationcraft_deathknight_frost_2h.lua
index 147c084..c43c533 100644
--- a/scripts/simulationcraft_deathknight_frost_2h.lua
+++ b/scripts/simulationcraft_deathknight_frost_2h.lua
@@ -43,7 +43,17 @@ AddFunction InterruptActions
 	}
 }

-AddFunction FrostTwoHanderDefaultActions
+### actions.default
+
+AddFunction FrostTwoHanderDefaultMainActions
+{
+	#run_action_list,name=aoe,if=active_enemies>=3
+	if Enemies() >= 3 FrostTwoHanderAoeMainActions()
+	#run_action_list,name=single_target,if=active_enemies<3
+	if Enemies() < 3 FrostTwoHanderSingleTargetMainActions()
+}
+
+AddFunction FrostTwoHanderDefaultShortCdActions
 {
 	#auto_attack
 	#deaths_advance,if=movement.remains>2
@@ -52,6 +62,14 @@ AddFunction FrostTwoHanderDefaultActions
 	if IncomingDamage(1.5) > 0 Spell(antimagic_shell)
 	#pillar_of_frost
 	Spell(pillar_of_frost)
+	#run_action_list,name=aoe,if=active_enemies>=3
+	if Enemies() >= 3 FrostTwoHanderAoeShortCdActions()
+	#run_action_list,name=single_target,if=active_enemies<3
+	if Enemies() < 3 FrostTwoHanderSingleTargetShortCdActions()
+}
+
+AddFunction FrostTwoHanderDefaultCdActions
+{
 	#potion,name=draenic_strength,if=target.time_to_die<=30|(target.time_to_die<=60&buff.pillar_of_frost.up)
 	if target.TimeToDie() <= 30 or target.TimeToDie() <= 60 and BuffPresent(pillar_of_frost_buff) UsePotionStrength()
 	#empower_rune_weapon,if=target.time_to_die<=60&buff.potion.up
@@ -65,75 +83,130 @@ AddFunction FrostTwoHanderDefaultActions
 	#use_item,slot=trinket2
 	UseItemActions()
 	#run_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 FrostTwoHanderAoeActions()
+	if Enemies() >= 3 FrostTwoHanderAoeCdActions()
 	#run_action_list,name=single_target,if=active_enemies<3
-	if Enemies() < 3 FrostTwoHanderSingleTargetActions()
+	if Enemies() < 3 FrostTwoHanderSingleTargetCdActions()
 }

-AddFunction FrostTwoHanderAoeActions
+### actions.aoe
+
+AddFunction FrostTwoHanderAoeMainActions
 {
-	#unholy_blight
-	Spell(unholy_blight)
 	#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)
-	#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) FrostTwoHanderBosAoeActions()
+	if BuffPresent(breath_of_sindragosa_buff) FrostTwoHanderBosAoeMainActions()
 	#howling_blast
 	Spell(howling_blast)
-	#blood_tap,if=buff.blood_charge.stack>10
-	if BuffStacks(blood_charge_buff) > 10 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 	#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)
-	#blood_tap
-	if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 	#frost_strike,if=!talent.breath_of_sindragosa.enabled|cooldown.breath_of_sindragosa.remains>=10
 	if not Talent(breath_of_sindragosa_talent) or SpellCooldown(breath_of_sindragosa) >= 10 Spell(frost_strike)
 	#plague_leech
 	if target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
 	#plague_strike,if=unholy=1
 	if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(plague_strike)
-	#empower_rune_weapon
-	Spell(empower_rune_weapon)
 }

-AddFunction FrostTwoHanderBosAoeActions
+AddFunction FrostTwoHanderAoeShortCdActions
+{
+	#unholy_blight
+	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)
+	{
+		#defile
+		Spell(defile)
+		#run_action_list,name=bos_aoe,if=dot.breath_of_sindragosa.ticking
+		if BuffPresent(breath_of_sindragosa_buff) FrostTwoHanderBosAoeShortCdActions()
+
+		unless Spell(howling_blast)
+		{
+			#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() > 88 and Spell(frost_strike)
+			{
+				#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)
+				}
+			}
+		}
+	}
+}
+
+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)
+	{
+		#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 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)
+		}
+	}
+}
+
+### actions.bos_aoe
+
+AddFunction FrostTwoHanderBosAoeMainActions
 {
 	#howling_blast
 	Spell(howling_blast)
-	#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)
 	#plague_strike,if=unholy=2
 	if Rune(unholy) >= 2 Spell(plague_strike)
-	#blood_tap
-	if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 	#plague_leech
 	if target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
 	#plague_strike,if=unholy=1
 	if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(plague_strike)
-	#empower_rune_weapon
-	Spell(empower_rune_weapon)
 }

-AddFunction FrostTwoHanderBosStActions
+AddFunction FrostTwoHanderBosAoeShortCdActions
+{
+	unless Spell(howling_blast)
+	{
+		#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) >= 2 and Spell(plague_strike)
+		{
+			#blood_tap
+			if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+		}
+	}
+}
+
+AddFunction FrostTwoHanderBosAoeCdActions
+{
+	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)
+	}
+}
+
+### actions.bos_st
+
+AddFunction FrostTwoHanderBosStMainActions
 {
 	#obliterate,if=buff.killing_machine.react
 	if BuffPresent(killing_machine_buff) Spell(obliterate)
-	#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)
 	#plague_leech,if=buff.killing_machine.react
 	if BuffPresent(killing_machine_buff) and target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
-	#blood_tap,if=buff.blood_charge.stack>=5
-	if BuffStacks(blood_charge_buff) >= 5 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 	#plague_leech
 	if target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
 	#obliterate,if=runic_power<76
@@ -142,7 +215,24 @@ AddFunction FrostTwoHanderBosStActions
 	if { Rune(death) >= 1 and Rune(death) < 2 and Rune(frost) >= 0 and Rune(frost) < 1 and Rune(unholy) >= 0 and Rune(unholy) < 1 or Rune(death) >= 0 and Rune(death) < 1 and Rune(frost) >= 1 and Rune(frost) < 2 and Rune(unholy) >= 0 and Rune(unholy) < 1 } and RunicPower() < 88 Spell(howling_blast)
 }

-AddFunction FrostTwoHanderPrecombatActions
+AddFunction FrostTwoHanderBosStShortCdActions
+{
+	unless BuffPresent(killing_machine_buff) and Spell(obliterate)
+	{
+		#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)
+		{
+			#blood_tap,if=buff.blood_charge.stack>=5
+			if BuffStacks(blood_charge_buff) >= 5 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+		}
+	}
+}
+
+### actions.precombat
+
+AddFunction FrostTwoHanderPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=calamari_crepes
@@ -150,43 +240,47 @@ AddFunction FrostTwoHanderPrecombatActions
 	if BuffExpires(attack_power_multiplier_buff any=1) Spell(horn_of_winter)
 	#frost_presence
 	Spell(frost_presence)
-	#snapshot_stats
-	#army_of_the_dead
-	Spell(army_of_the_dead)
-	#potion,name=draenic_strength
-	UsePotionStrength()
-	#pillar_of_frost
-	Spell(pillar_of_frost)
 }

-AddFunction FrostTwoHanderSingleTargetActions
+AddFunction FrostTwoHanderPrecombatShortCdActions
+{
+	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter) or Spell(frost_presence)
+	{
+		#pillar_of_frost
+		Spell(pillar_of_frost)
+	}
+}
+
+AddFunction FrostTwoHanderPrecombatCdActions
+{
+	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
+		UsePotionStrength()
+	}
+}
+
+### actions.single_target
+
+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)
-	#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)
 	#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
 	if BuffPresent(killing_machine_buff) Spell(obliterate)
-	#blood_tap,if=buff.killing_machine.react
-	if BuffPresent(killing_machine_buff) and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 	#howling_blast,if=!talent.necrotic_plague.enabled&!dot.frost_fever.ticking&buff.rime.react
 	if not Talent(necrotic_plague_talent) and not target.DebuffPresent(frost_fever_debuff) and BuffPresent(rime_buff) Spell(howling_blast)
 	#outbreak,if=!disease.max_ticking
 	if not target.DiseasesAnyTicking() Spell(outbreak)
-	#unholy_blight,if=!disease.min_ticking
-	if not target.DiseasesTicking() 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) 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
@@ -197,8 +291,6 @@ AddFunction FrostTwoHanderSingleTargetActions
 	if Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) Spell(howling_blast)
 	#plague_strike,if=!talent.necrotic_plague.enabled&!dot.blood_plague.ticking
 	if not Talent(necrotic_plague_talent) and not target.DebuffPresent(blood_plague_debuff) Spell(plague_strike)
-	#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)
 	#frost_strike,if=runic_power>76
 	if RunicPower() > 76 Spell(frost_strike)
 	#howling_blast,if=buff.rime.react&disease.min_remains>5&(blood.frac>=1.8|unholy.frac>=1.8|frost.frac>=1.8)
@@ -215,26 +307,103 @@ AddFunction FrostTwoHanderSingleTargetActions
 	if BuffPresent(rime_buff) and target.DiseasesRemaining() > 5 Spell(howling_blast)
 	#obliterate,if=blood.frac>=1.5|unholy.frac>=1.6|frost.frac>=1.6|buff.bloodlust.up|cooldown.plague_leech.remains<=4
 	if 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 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)
 	#frost_strike,if=!buff.killing_machine.react
 	if not BuffPresent(killing_machine_buff) Spell(frost_strike)
 	#plague_leech,if=(blood.frac<=0.95&unholy.frac<=0.95)|(frost.frac<=0.95&unholy.frac<=0.95)|(frost.frac<=0.95&blood.frac<=0.95)
 	if { 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 } Spell(plague_leech)
-	#empower_rune_weapon
-	Spell(empower_rune_weapon)
+}
+
+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)
+	{
+		#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 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=buff.killing_machine.react
+			if BuffPresent(killing_machine_buff) and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+
+			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)
+			{
+				#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 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)
+				{
+					#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 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>=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)
+					}
+				}
+			}
+		}
+	}
+}
+
+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) 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)
+
+		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)
+		}
+	}
+}
+
+### Frost icons.
+AddCheckBox(opt_deathknight_frost_aoe L(AOE) specialization=frost default)
+
+AddIcon specialization=frost help=shortcd enemies=1 checkbox=!opt_deathknight_frost_aoe
+{
+	if not InCombat() FrostTwoHanderPrecombatShortCdActions()
+	FrostTwoHanderDefaultShortCdActions()
+}
+
+AddIcon specialization=frost help=shortcd checkbox=opt_deathknight_frost_aoe
+{
+	if not InCombat() FrostTwoHanderPrecombatShortCdActions()
+	FrostTwoHanderDefaultShortCdActions()
 }

 AddIcon specialization=frost help=main enemies=1
 {
-	if not InCombat() FrostTwoHanderPrecombatActions()
-	FrostTwoHanderDefaultActions()
+	if not InCombat() FrostTwoHanderPrecombatMainActions()
+	FrostTwoHanderDefaultMainActions()
+}
+
+AddIcon specialization=frost help=aoe checkbox=opt_deathknight_frost_aoe
+{
+	if not InCombat() FrostTwoHanderPrecombatMainActions()
+	FrostTwoHanderDefaultMainActions()
+}
+
+AddIcon specialization=frost help=cd enemies=1 checkbox=!opt_deathknight_frost_aoe
+{
+	if not InCombat() FrostTwoHanderPrecombatCdActions()
+	FrostTwoHanderDefaultCdActions()
 }

-AddIcon specialization=frost help=aoe
+AddIcon specialization=frost help=cd checkbox=opt_deathknight_frost_aoe
 {
-	if not InCombat() FrostTwoHanderPrecombatActions()
-	FrostTwoHanderDefaultActions()
+	if not InCombat() FrostTwoHanderPrecombatCdActions()
+	FrostTwoHanderDefaultCdActions()
 }

 ### Required symbols
@@ -273,7 +442,6 @@ AddIcon specialization=frost help=aoe
 # pillar_of_frost_buff
 # plague_leech
 # plague_strike
-# potion_strength_buff
 # quaking_palm
 # rime_buff
 # runic_empowerment_talent
diff --git a/scripts/simulationcraft_deathknight_unholy.lua b/scripts/simulationcraft_deathknight_unholy.lua
index 50819e4..7cc6ede 100644
--- a/scripts/simulationcraft_deathknight_unholy.lua
+++ b/scripts/simulationcraft_deathknight_unholy.lua
@@ -36,13 +36,31 @@ AddFunction InterruptActions
 	}
 }

-AddFunction UnholyDefaultActions
+### actions.default
+
+AddFunction UnholyDefaultMainActions
+{
+	#run_action_list,name=aoe,if=active_enemies>=2
+	if Enemies() >= 2 UnholyAoeMainActions()
+	#run_action_list,name=single_target,if=active_enemies<2
+	if Enemies() < 2 UnholySingleTargetMainActions()
+}
+
+AddFunction UnholyDefaultShortCdActions
 {
 	#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)
+	#run_action_list,name=aoe,if=active_enemies>=2
+	if Enemies() >= 2 UnholyAoeShortCdActions()
+	#run_action_list,name=single_target,if=active_enemies<2
+	if Enemies() < 2 UnholySingleTargetShortCdActions()
+}
+
+AddFunction UnholyDefaultCdActions
+{
 	#blood_fury
 	Spell(blood_fury_ap)
 	#berserking
@@ -52,42 +70,28 @@ AddFunction UnholyDefaultActions
 	#potion,name=draenic_strength,if=buff.dark_transformation.up&target.time_to_die<=60
 	if pet.BuffPresent(dark_transformation_buff any=1) and target.TimeToDie() <= 60 UsePotionStrength()
 	#run_action_list,name=aoe,if=active_enemies>=2
-	if Enemies() >= 2 UnholyAoeActions()
+	if Enemies() >= 2 UnholyAoeCdActions()
 	#run_action_list,name=single_target,if=active_enemies<2
-	if Enemies() < 2 UnholySingleTargetActions()
+	if Enemies() < 2 UnholySingleTargetCdActions()
 }

-AddFunction UnholyAoeActions
+### actions.aoe
+
+AddFunction UnholyAoeMainActions
 {
-	#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) UnholySpreadActions()
-	#defile
-	Spell(defile)
-	#breath_of_sindragosa,if=runic_power>75
-	if RunicPower() > 75 Spell(breath_of_sindragosa)
+	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)
-	#summon_gargoyle
-	Spell(summon_gargoyle)
 	#dark_transformation
 	if BuffStacks(shadow_infusion_buff) >= 5 Spell(dark_transformation)
-	#blood_tap,if=buff.shadow_infusion.stack=5
-	if 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)
 	#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)
-	#blood_tap,if=buff.blood_charge.stack>10
-	if BuffStacks(blood_charge_buff) > 10 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-	#death_coil,if=runic_power>90|buff.sudden_doom.react|(buff.dark_transformation.down&rune.unholy<=1)
+	#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)
@@ -97,53 +101,143 @@ AddFunction UnholyAoeActions
 	if Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(scourge_strike)
 	#death_coil
 	Spell(death_coil)
-	#blood_tap
-	if BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
 	#plague_leech
 	if target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
-	#empower_rune_weapon
-	Spell(empower_rune_weapon)
 }

-AddFunction UnholyBosAoeActions
+AddFunction UnholyAoeShortCdActions
+{
+	#unholy_blight
+	Spell(unholy_blight)
+	#defile
+	Spell(defile)
+	#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) or BuffStacks(shadow_infusion_buff) >= 5 and Spell(dark_transformation)
+	{
+		#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)
+		{
+			#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 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 BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+			}
+		}
+	}
+}
+
+AddFunction UnholyAoeCdActions
+{
+	unless Spell(unholy_blight)
+	{
+		unless 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) UnholyBosAoeCdActions()
+
+			unless { Rune(blood) >= 2 or Rune(frost) >= 2 and Rune(death) >= 2 and Rune(death) < 3 } and Spell(blood_boil)
+			{
+				#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)
+				}
+			}
+		}
+	}
+}
+
+### actions.bos_aoe
+
+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
 	if RunicPower() < 88 and Rune(unholy) >= 1 and Rune(unholy) < 2 Spell(scourge_strike)
 	#icy_touch,if=runic_power<88
 	if RunicPower() < 88 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)
 	#plague_leech
 	if target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
-	#empower_rune_weapon
-	Spell(empower_rune_weapon)
 	#death_coil,if=buff.sudden_doom.react
 	if BuffPresent(sudden_doom_buff) Spell(death_coil)
 }

-AddFunction UnholyBosStActions
+AddFunction UnholyBosAoeShortCdActions
 {
 	#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)
+	}
+}
+
+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 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)
+	}
+}
+
+### actions.bos_st
+
+AddFunction UnholyBosStMainActions
+{
 	#festering_strike,if=runic_power<77
 	if RunicPower() < 77 Spell(festering_strike)
 	#scourge_strike,if=runic_power<88
 	if RunicPower() < 88 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)
 	#plague_leech
 	if target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
-	#empower_rune_weapon
-	Spell(empower_rune_weapon)
 	#death_coil,if=buff.sudden_doom.react
 	if BuffPresent(sudden_doom_buff) Spell(death_coil)
 }

-AddFunction UnholyPrecombatActions
+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)
+	{
+		#blood_tap,if=buff.blood_charge.stack>=5
+		if BuffStacks(blood_charge_buff) >= 5 and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
+	}
+}
+
+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)
+	{
+		#empower_rune_weapon
+		Spell(empower_rune_weapon)
+	}
+}
+
+### actions.precombat
+
+AddFunction UnholyPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=calamari_crepes
@@ -151,16 +245,32 @@ AddFunction UnholyPrecombatActions
 	if BuffExpires(attack_power_multiplier_buff any=1) Spell(horn_of_winter)
 	#unholy_presence
 	Spell(unholy_presence)
-	#snapshot_stats
-	#army_of_the_dead
-	Spell(army_of_the_dead)
-	#potion,name=draenic_strength
-	UsePotionStrength()
-	#raise_dead
-	Spell(raise_dead)
 }

-AddFunction UnholySingleTargetActions
+AddFunction UnholyPrecombatShortCdActions
+{
+	unless BuffExpires(attack_power_multiplier_buff any=1) and Spell(horn_of_winter) or Spell(unholy_presence)
+	{
+		#raise_dead
+		Spell(raise_dead)
+	}
+}
+
+AddFunction UnholyPrecombatCdActions
+{
+	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
+		UsePotionStrength()
+	}
+}
+
+### actions.single_target
+
+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)
@@ -170,20 +280,10 @@ AddFunction UnholySingleTargetActions
 	if 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 } Spell(plague_leech)
 	#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)
-	#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)
 	#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)
-	#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)
 	#outbreak,if=!talent.necrotic_plague.enabled&(!dot.frost_fever.ticking|!dot.blood_plague.ticking)
 	if not Talent(necrotic_plague_talent) and { not target.DebuffPresent(frost_fever_debuff) or not target.DebuffPresent(blood_plague_debuff) } Spell(outbreak)
 	#outbreak,if=talent.necrotic_plague.enabled&!dot.necrotic_plague.ticking
@@ -192,49 +292,109 @@ AddFunction UnholySingleTargetActions
 	if not Talent(necrotic_plague_talent) and { not target.DebuffPresent(blood_plague_debuff) or not target.DebuffPresent(frost_fever_debuff) } Spell(plague_strike)
 	#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)
-	#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) UnholyBosStActions()
-	#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)
+	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
 	if SpellCooldown(breath_of_sindragosa) < 7 and RunicPower() < 76 and Talent(breath_of_sindragosa_talent) Spell(festering_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)
 	#scourge_strike,if=unholy=2
 	if Rune(unholy) >= 2 Spell(scourge_strike)
 	#death_coil,if=runic_power>80
 	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_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 Rune(unholy) < 2 } and BuffStacks(blood_charge_buff) >= 5 Spell(blood_tap)
-	#death_coil,if=buff.sudden_doom.react|(buff.dark_transformation.down&rune.unholy<=1)
+	#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
 	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_coil
 	Spell(death_coil)
 	#plague_leech
 	if target.DiseasesTicking() and { Rune(blood) < 1 or Rune(frost) < 1 or Rune(unholy) < 1 } Spell(plague_leech)
-	#empower_rune_weapon
-	Spell(empower_rune_weapon)
 }

-AddFunction UnholySpreadActions
+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)
+	{
+		#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)
+
+		unless RunicPower() > 90 and Spell(death_coil)
+		{
+			#defile
+			Spell(defile)
+
+			unless 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)
+				{
+					#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,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)
+						{
+							#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)
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+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() <= 45 and Spell(soul_reaper_unholy)
+	{
+		#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)
+		{
+			#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)
+			}
+		}
+	}
+}
+
+### actions.spread
+
+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)
@@ -248,16 +408,43 @@ AddFunction UnholySpreadActions
 	if Talent(necrotic_plague_talent) and not target.DebuffPresent(necrotic_plague_debuff) Spell(plague_strike)
 }

+### Unholy icons.
+AddCheckBox(opt_deathknight_unholy_aoe L(AOE) specialization=unholy default)
+
+AddIcon specialization=unholy help=shortcd enemies=1 checkbox=!opt_deathknight_unholy_aoe
+{
+	if not InCombat() UnholyPrecombatShortCdActions()
+	UnholyDefaultShortCdActions()
+}
+
+AddIcon specialization=unholy help=shortcd checkbox=opt_deathknight_unholy_aoe
+{
+	if not InCombat() UnholyPrecombatShortCdActions()
+	UnholyDefaultShortCdActions()
+}
+
 AddIcon specialization=unholy help=main enemies=1
 {
-	if not InCombat() UnholyPrecombatActions()
-	UnholyDefaultActions()
+	if not InCombat() UnholyPrecombatMainActions()
+	UnholyDefaultMainActions()
+}
+
+AddIcon specialization=unholy help=aoe checkbox=opt_deathknight_unholy_aoe
+{
+	if not InCombat() UnholyPrecombatMainActions()
+	UnholyDefaultMainActions()
+}
+
+AddIcon specialization=unholy help=cd enemies=1 checkbox=!opt_deathknight_unholy_aoe
+{
+	if not InCombat() UnholyPrecombatCdActions()
+	UnholyDefaultCdActions()
 }

-AddIcon specialization=unholy help=aoe
+AddIcon specialization=unholy help=cd checkbox=opt_deathknight_unholy_aoe
 {
-	if not InCombat() UnholyPrecombatActions()
-	UnholyDefaultActions()
+	if not InCombat() UnholyPrecombatCdActions()
+	UnholyDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_druid_balance.lua b/scripts/simulationcraft_druid_balance.lua
index 368fedb..fa7c60d 100644
--- a/scripts/simulationcraft_druid_balance.lua
+++ b/scripts/simulationcraft_druid_balance.lua
@@ -20,7 +20,19 @@ AddFunction UsePotionIntellect
 	if CheckBoxOn(opt_potion_intellect) and target.Classification(worldboss) Item(draenic_intellect_potion usable=1)
 }

-AddFunction BalanceDefaultActions
+### actions.default
+
+AddFunction BalanceDefaultMainActions
+{
+	#force_of_nature,if=trinket.stat.intellect.up|charges=3|target.time_to_die<21
+	if BuffPresent(trinket_stat_intellect_buff) or Charges(force_of_nature_caster) == 3 or target.TimeToDie() < 21 Spell(force_of_nature_caster)
+	#call_action_list,name=single_target,if=active_enemies=1
+	if Enemies() == 1 BalanceSingleTargetMainActions()
+	#call_action_list,name=aoe,if=active_enemies>1
+	if Enemies() > 1 BalanceAoeMainActions()
+}
+
+AddFunction BalanceDefaultCdActions
 {
 	#potion,name=draenic_intellect,if=buff.celestial_alignment.up
 	if BuffPresent(celestial_alignment_buff) UsePotionIntellect()
@@ -30,20 +42,20 @@ AddFunction BalanceDefaultActions
 	if BuffPresent(celestial_alignment_buff) Spell(berserking)
 	#arcane_torrent,if=buff.celestial_alignment.up
 	if BuffPresent(celestial_alignment_buff) Spell(arcane_torrent_energy)
-	#force_of_nature,if=trinket.stat.intellect.up|charges=3|target.time_to_die<21
-	if BuffPresent(trinket_stat_intellect_buff) or Charges(force_of_nature_caster) == 3 or target.TimeToDie() < 21 Spell(force_of_nature_caster)
-	#call_action_list,name=single_target,if=active_enemies=1
-	if Enemies() == 1 BalanceSingleTargetActions()
-	#call_action_list,name=aoe,if=active_enemies>1
-	if Enemies() > 1 BalanceAoeActions()
+
+	unless { BuffPresent(trinket_stat_intellect_buff) or Charges(force_of_nature_caster) == 3 or target.TimeToDie() < 21 } and Spell(force_of_nature_caster)
+	{
+		#call_action_list,name=single_target,if=active_enemies=1
+		if Enemies() == 1 BalanceSingleTargetCdActions()
+		#call_action_list,name=aoe,if=active_enemies>1
+		if Enemies() > 1 BalanceAoeCdActions()
+	}
 }

-AddFunction BalanceAoeActions
+### actions.aoe
+
+AddFunction BalanceAoeMainActions
 {
-	#celestial_alignment,if=lunar_max<8|target.time_to_die<20
-	if TimeToEclipse(lunar) < 8 or target.TimeToDie() < 20 Spell(celestial_alignment)
-	#incarnation,if=buff.celestial_alignment.up
-	if BuffPresent(celestial_alignment_buff) Spell(incarnation_caster)
 	#sunfire,cycle_targets=1,if=remains<8
 	if target.DebuffRemaining(sunfire_debuff) < 8 Spell(sunfire)
 	#starfall,if=!buff.starfall.up&active_enemies>2
@@ -64,7 +76,17 @@ AddFunction BalanceAoeActions
 	if EclipseEnergy() >= 0 and TimeToEclipse() > CastTime(starfire) or EclipseEnergy() < 0 and CastTime(starfire) > TimeToEclipse() Spell(starfire)
 }

-AddFunction BalancePrecombatActions
+AddFunction BalanceAoeCdActions
+{
+	#celestial_alignment,if=lunar_max<8|target.time_to_die<20
+	if TimeToEclipse(lunar) < 8 or target.TimeToDie() < 20 Spell(celestial_alignment)
+	#incarnation,if=buff.celestial_alignment.up
+	if BuffPresent(celestial_alignment_buff) Spell(incarnation_caster)
+}
+
+### actions.precombat
+
+AddFunction BalancePrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=sleeper_surprise
@@ -72,14 +94,23 @@ AddFunction BalancePrecombatActions
 	if not BuffPresent(str_agi_int_buff any=1) Spell(mark_of_the_wild)
 	#moonkin_form
 	Spell(moonkin_form)
-	#snapshot_stats
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#stellar_flare
 	Spell(stellar_flare)
 }

-AddFunction BalanceSingleTargetActions
+AddFunction BalancePrecombatCdActions
+{
+	unless not BuffPresent(str_agi_int_buff any=1) and Spell(mark_of_the_wild) or Spell(moonkin_form)
+	{
+		#snapshot_stats
+		#potion,name=draenic_intellect
+		UsePotionIntellect()
+	}
+}
+
+### actions.single_target
+
+AddFunction BalanceSingleTargetMainActions
 {
 	#starsurge,if=buff.lunar_empowerment.down&eclipse_energy>20
 	if BuffExpires(lunar_empowerment_buff) and EclipseEnergy() > 20 Spell(starsurge)
@@ -87,10 +118,6 @@ AddFunction BalanceSingleTargetActions
 	if BuffExpires(solar_empowerment_buff) and EclipseEnergy() < -40 Spell(starsurge)
 	#starsurge,if=(charges=2&recharge_time<6)|charges=3
 	if Charges(starsurge) == 2 and SpellChargeCooldown(starsurge) < 6 or Charges(starsurge) == 3 Spell(starsurge)
-	#celestial_alignment,if=eclipse_energy>40
-	if EclipseEnergy() > 40 Spell(celestial_alignment)
-	#incarnation,if=eclipse_energy>0
-	if EclipseEnergy() > 0 Spell(incarnation_caster)
 	#sunfire,if=remains<7|buff.solar_peak.up
 	if target.DebuffRemaining(sunfire_debuff) < 7 or BuffPresent(solar_peak_buff) Spell(sunfire)
 	#stellar_flare,if=remains<7
@@ -103,16 +130,50 @@ AddFunction BalanceSingleTargetActions
 	if EclipseEnergy() >= 0 and TimeToEclipse() > CastTime(starfire) or EclipseEnergy() < 0 and CastTime(starfire) > TimeToEclipse() Spell(starfire)
 }

+AddFunction BalanceSingleTargetCdActions
+{
+	unless BuffExpires(lunar_empowerment_buff) and EclipseEnergy() > 20 and Spell(starsurge) or BuffExpires(solar_empowerment_buff) and EclipseEnergy() < -40 and Spell(starsurge) or { Charges(starsurge) == 2 and SpellChargeCooldown(starsurge) < 6 or Charges(starsurge) == 3 } and Spell(starsurge)
+	{
+		#celestial_alignment,if=eclipse_energy>40
+		if EclipseEnergy() > 40 Spell(celestial_alignment)
+		#incarnation,if=eclipse_energy>0
+		if EclipseEnergy() > 0 Spell(incarnation_caster)
+	}
+}
+
+### Balance icons.
+AddCheckBox(opt_druid_balance_aoe L(AOE) specialization=balance default)
+
+AddIcon specialization=balance help=shortcd enemies=1 checkbox=!opt_druid_balance_aoe
+{
+}
+
+AddIcon specialization=balance help=shortcd checkbox=opt_druid_balance_aoe
+{
+}
+
 AddIcon specialization=balance help=main enemies=1
 {
-	if not InCombat() BalancePrecombatActions()
-	BalanceDefaultActions()
+	if not InCombat() BalancePrecombatMainActions()
+	BalanceDefaultMainActions()
+}
+
+AddIcon specialization=balance help=aoe checkbox=opt_druid_balance_aoe
+{
+	if not InCombat() BalancePrecombatMainActions()
+	BalanceDefaultMainActions()
+}
+
+AddIcon specialization=balance help=cd enemies=1 checkbox=!opt_druid_balance_aoe
+{
+	if not InCombat() BalancePrecombatCdActions()
+	BalanceDefaultCdActions()
 }

-AddIcon specialization=balance help=aoe
+AddIcon specialization=balance help=cd checkbox=opt_druid_balance_aoe
 {
-	if not InCombat() BalancePrecombatActions()
-	BalanceDefaultActions()
+	if not InCombat() BalancePrecombatCdActions()
+	BalanceDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_druid_feral.lua b/scripts/simulationcraft_druid_feral.lua
index 2e25bb0..161fa22 100644
--- a/scripts/simulationcraft_druid_feral.lua
+++ b/scripts/simulationcraft_druid_feral.lua
@@ -52,49 +52,20 @@ AddFunction InterruptActions
 	}
 }

-AddFunction FeralDefaultActions
+### actions.default
+
+AddFunction FeralDefaultMainActions
 {
 	#cat_form
 	Spell(cat_form)
-	#wild_charge
-	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
-	if 0 and BuffExpires(displacer_beast_buff) and True(wild_charge_movement_down) Spell(dash)
 	#rake,if=buff.prowl.up|buff.shadowmeld.up
 	if BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) Spell(rake)
-	#auto_attack
-	#skull_bash
-	InterruptActions()
-	#force_of_nature,if=charges=3|trinket.proc.all.react|target.time_to_die<20
-	if Charges(force_of_nature_melee) == 3 or BuffPresent(trinket_proc_any_buff) or target.TimeToDie() < 20 Spell(force_of_nature_melee)
-	#potion,name=draenic_agility,if=target.time_to_die<=40
-	if target.TimeToDie() <= 40 UsePotionAgility()
-	#use_item,slot=trinket1,sync=tigers_fury
-	if not SpellCooldown(tigers_fury) > 0 UseItemActions()
-	#blood_fury,sync=tigers_fury
-	if not SpellCooldown(tigers_fury) > 0 Spell(blood_fury_apsp)
-	#berserking,sync=tigers_fury
-	if not SpellCooldown(tigers_fury) > 0 Spell(berserking)
-	#arcane_torrent,sync=tigers_fury
-	if not SpellCooldown(tigers_fury) > 0 Spell(arcane_torrent_energy)
-	#tigers_fury,if=(!buff.omen_of_clarity.react&energy.max-energy>=60)|energy.max-energy>=80
-	if not BuffPresent(omen_of_clarity_melee_buff) and MaxEnergy() - Energy() >= 60 or MaxEnergy() - Energy() >= 80 Spell(tigers_fury)
-	#incarnation,if=cooldown.berserk.remains<10&energy.time_to_max>1
-	if SpellCooldown(berserk_cat) < 10 and TimeToMaxEnergy() > 1 Spell(incarnation_melee)
-	#potion,name=draenic_agility,sync=berserk,if=target.health.pct<25
-	if target.HealthPercent() < 25 and not SpellCooldown(berserk_cat) > 0 UsePotionAgility()
-	#berserk,if=buff.tigers_fury.up
-	if BuffPresent(tigers_fury_buff) Spell(berserk_cat)
-	#shadowmeld,if=dot.rake.remains<4.5&energy>=35&dot.rake.pmultiplier<2&(buff.bloodtalons.up|!talent.bloodtalons.enabled)&(!talent.incarnation.enabled|cooldown.incarnation.remains>15)&!buff.king_of_the_jungle.up
-	if target.DebuffRemaining(rake_debuff) < 4.5 and Energy() >= 35 and target.DebuffPersistentMultiplier(rake_debuff) < 2 and { BuffPresent(bloodtalons_buff) or not Talent(bloodtalons_talent) } and { not Talent(incarnation_talent) or SpellCooldown(incarnation_melee) > 15 } and not BuffPresent(king_of_the_jungle_buff) Spell(shadowmeld)
 	#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
@@ -105,15 +76,66 @@ 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()
+		if ComboPoints() < 5 FeralGeneratorMainActions()
+	}
+}
+
+AddFunction FeralDefaultShortCdActions
+{
+	unless Spell(cat_form)
+	{
+		#wild_charge
+		GetInMeleeRange()
+		#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
+		if 0 and BuffExpires(displacer_beast_buff) and True(wild_charge_movement_down) Spell(dash)
+
+		unless { BuffPresent(prowl_buff) or BuffPresent(shadowmeld_buff) } and Spell(rake)
+		{
+			#force_of_nature,if=charges=3|trinket.proc.all.react|target.time_to_die<20
+			if Charges(force_of_nature_melee) == 3 or BuffPresent(trinket_proc_any_buff) or target.TimeToDie() < 20 Spell(force_of_nature_melee)
+			#tigers_fury,if=(!buff.omen_of_clarity.react&energy.max-energy>=60)|energy.max-energy>=80
+			if not BuffPresent(omen_of_clarity_melee_buff) and MaxEnergy() - Energy() >= 60 or MaxEnergy() - Energy() >= 80 Spell(tigers_fury)
+		}
 	}
 }

-AddFunction FeralFinisherActions
+AddFunction FeralDefaultCdActions
+{
+	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()
+		#use_item,slot=trinket1,sync=tigers_fury
+		if not SpellCooldown(tigers_fury) > 0 UseItemActions()
+		#blood_fury,sync=tigers_fury
+		if not SpellCooldown(tigers_fury) > 0 Spell(blood_fury_apsp)
+		#berserking,sync=tigers_fury
+		if not SpellCooldown(tigers_fury) > 0 Spell(berserking)
+		#arcane_torrent,sync=tigers_fury
+		if not SpellCooldown(tigers_fury) > 0 Spell(arcane_torrent_energy)
+		#incarnation,if=cooldown.berserk.remains<10&energy.time_to_max>1
+		if SpellCooldown(berserk_cat) < 10 and TimeToMaxEnergy() > 1 Spell(incarnation_melee)
+		#potion,name=draenic_agility,sync=berserk,if=target.health.pct<25
+		if target.HealthPercent() < 25 and not SpellCooldown(berserk_cat) > 0 UsePotionAgility()
+		#berserk,if=buff.tigers_fury.up
+		if BuffPresent(tigers_fury_buff) Spell(berserk_cat)
+		#shadowmeld,if=dot.rake.remains<4.5&energy>=35&dot.rake.pmultiplier<2&(buff.bloodtalons.up|!talent.bloodtalons.enabled)&(!talent.incarnation.enabled|cooldown.incarnation.remains>15)&!buff.king_of_the_jungle.up
+		if target.DebuffRemaining(rake_debuff) < 4.5 and Energy() >= 35 and target.DebuffPersistentMultiplier(rake_debuff) < 2 and { BuffPresent(bloodtalons_buff) or not Talent(bloodtalons_talent) } and { not Talent(incarnation_talent) or SpellCooldown(incarnation_melee) > 15 } and not BuffPresent(king_of_the_jungle_buff) Spell(shadowmeld)
+	}
+}
+
+### actions.finisher
+
+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)
@@ -122,12 +144,14 @@ AddFunction FeralFinisherActions
 	#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)
 }

-AddFunction FeralGeneratorActions
+### actions.generator
+
+AddFunction FeralGeneratorMainActions
 {
 	#swipe,if=active_enemies>=3
 	if Enemies() >= 3 Spell(swipe)
@@ -135,7 +159,9 @@ AddFunction FeralGeneratorActions
 	if Enemies() < 3 Spell(shred)
 }

-AddFunction FeralMaintainActions
+### actions.maintain
+
+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)
@@ -151,7 +177,9 @@ AddFunction FeralMaintainActions
 	if PersistentMultiplier(rake_debuff) > target.DebuffPersistentMultiplier(rake_debuff) and ComboPoints() < 5 and Enemies() == 1 Spell(rake)
 }

-AddFunction FeralPrecombatActions
+### actions.precombat
+
+AddFunction FeralPrecombatMainActions
 {
 	#flask,type=greater_draenic_agility_flask
 	#food,type=blackrock_barbecue
@@ -163,21 +191,53 @@ AddFunction FeralPrecombatActions
 	Spell(cat_form)
 	#prowl
 	if BuffExpires(stealthed_buff any=1) Spell(prowl)
-	#snapshot_stats
-	#potion,name=draenic_agility
-	UsePotionAgility()
+}
+
+AddFunction FeralPrecombatCdActions
+{
+	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()
+	}
+}
+
+### Feral icons.
+AddCheckBox(opt_druid_feral_aoe L(AOE) specialization=feral default)
+
+AddIcon specialization=feral help=shortcd enemies=1 checkbox=!opt_druid_feral_aoe
+{
+	FeralDefaultShortCdActions()
+}
+
+AddIcon specialization=feral help=shortcd checkbox=opt_druid_feral_aoe
+{
+	FeralDefaultShortCdActions()
 }

 AddIcon specialization=feral help=main enemies=1
 {
-	if not InCombat() FeralPrecombatActions()
-	FeralDefaultActions()
+	if not InCombat() FeralPrecombatMainActions()
+	FeralDefaultMainActions()
+}
+
+AddIcon specialization=feral help=aoe checkbox=opt_druid_feral_aoe
+{
+	if not InCombat() FeralPrecombatMainActions()
+	FeralDefaultMainActions()
+}
+
+AddIcon specialization=feral help=cd enemies=1 checkbox=!opt_druid_feral_aoe
+{
+	if not InCombat() FeralPrecombatCdActions()
+	FeralDefaultCdActions()
 }

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

 ### Required symbols
@@ -214,7 +274,6 @@ AddIcon specialization=feral help=aoe
 # rip
 # rip_debuff
 # savage_roar
-# savage_roar_buff
 # shadowmeld
 # shadowmeld_buff
 # shred
diff --git a/scripts/simulationcraft_druid_guardian.lua b/scripts/simulationcraft_druid_guardian.lua
index 8dbd9ad..a3e5ed9 100644
--- a/scripts/simulationcraft_druid_guardian.lua
+++ b/scripts/simulationcraft_druid_guardian.lua
@@ -44,49 +44,20 @@ AddFunction InterruptActions
 	}
 }

-AddFunction GuardianDefaultActions
+### actions.default
+
+AddFunction GuardianDefaultMainActions
 {
-	#auto_attack
-	#skull_bash
-	InterruptActions()
-	#savage_defense,if=buff.barkskin.down
-	if BuffExpires(barkskin_buff) Spell(savage_defense)
-	#blood_fury
-	Spell(blood_fury_apsp)
-	#berserking
-	Spell(berserking)
-	#arcane_torrent
-	Spell(arcane_torrent_energy)
-	#use_item,slot=trinket2
-	UseItemActions()
-	#barkskin,if=buff.bristling_fur.down
-	if BuffExpires(bristling_fur_buff) Spell(barkskin)
-	#bristling_fur,if=buff.barkskin.down&buff.savage_defense.down
-	if BuffExpires(barkskin_buff) and BuffExpires(savage_defense_buff) Spell(bristling_fur)
-	#maul,if=buff.tooth_and_claw.react&incoming_damage_1s
-	if BuffPresent(tooth_and_claw_buff) and IncomingDamage(1) > 0 Spell(maul)
-	#berserk,if=buff.pulverize.remains>10
-	if BuffRemaining(pulverize_buff) > 10 Spell(berserk_bear)
-	#frenzied_regeneration,if=rage>=80
-	if Rage() >= 80 Spell(frenzied_regeneration)
 	#cenarion_ward
 	Spell(cenarion_ward)
-	#renewal,if=health.pct<30
-	if HealthPercent() < 30 Spell(renewal)
-	#heart_of_the_wild
-	Spell(heart_of_the_wild_tank)
 	#rejuvenation,if=buff.heart_of_the_wild.up&remains<=3.6
 	if BuffPresent(heart_of_the_wild_tank_buff) and BuffRemaining(rejuvenation_buff) <= 3.6 and SpellKnown(enhanced_rejuvenation) Spell(rejuvenation)
-	#natures_vigil
-	Spell(natures_vigil)
 	#healing_touch,if=buff.dream_of_cenarius.react&health.pct<30
 	if BuffPresent(dream_of_cenarius_tank_buff) and HealthPercent() < 30 Spell(healing_touch)
 	#pulverize,if=buff.pulverize.remains<=3.6
 	if BuffRemaining(pulverize_buff) <= 3.6 and target.DebuffStacks(lacerate_debuff) >= 3 Spell(pulverize)
 	#lacerate,if=talent.pulverize.enabled&buff.pulverize.remains<=(3-dot.lacerate.stack)*gcd&buff.berserk.down
 	if Talent(pulverize_talent) and BuffRemaining(pulverize_buff) <= { 3 - target.DebuffStacks(lacerate_debuff) } * GCD() and BuffExpires(berserk_bear_buff) Spell(lacerate)
-	#incarnation
-	Spell(incarnation_tank)
 	#lacerate,if=!ticking
 	if not target.DebuffPresent(lacerate_debuff) Spell(lacerate)
 	#thrash_bear,if=!ticking
@@ -99,7 +70,60 @@ AddFunction GuardianDefaultActions
 	Spell(lacerate)
 }

-AddFunction GuardianPrecombatActions
+AddFunction GuardianDefaultShortCdActions
+{
+	#savage_defense,if=buff.barkskin.down
+	if BuffExpires(barkskin_buff) Spell(savage_defense)
+	#maul,if=buff.tooth_and_claw.react&incoming_damage_1s
+	if BuffPresent(tooth_and_claw_buff) and IncomingDamage(1) > 0 Spell(maul)
+	#frenzied_regeneration,if=rage>=80
+	if Rage() >= 80 Spell(frenzied_regeneration)
+}
+
+AddFunction GuardianDefaultCdActions
+{
+	#auto_attack
+	#skull_bash
+	InterruptActions()
+	#blood_fury
+	Spell(blood_fury_apsp)
+	#berserking
+	Spell(berserking)
+	#arcane_torrent
+	Spell(arcane_torrent_energy)
+	#use_item,slot=trinket2
+	UseItemActions()
+	#barkskin,if=buff.bristling_fur.down
+	if BuffExpires(bristling_fur_buff) Spell(barkskin)
+	#bristling_fur,if=buff.barkskin.down&buff.savage_defense.down
+	if BuffExpires(barkskin_buff) and BuffExpires(savage_defense_buff) Spell(bristling_fur)
+	#berserk,if=buff.pulverize.remains>10
+	if BuffRemaining(pulverize_buff) > 10 Spell(berserk_bear)
+
+	unless Spell(cenarion_ward)
+	{
+		#renewal,if=health.pct<30
+		if HealthPercent() < 30 Spell(renewal)
+		#heart_of_the_wild
+		Spell(heart_of_the_wild_tank)
+
+		unless BuffPresent(heart_of_the_wild_tank_buff) and BuffRemaining(rejuvenation_buff) <= 3.6 and SpellKnown(enhanced_rejuvenation) and Spell(rejuvenation)
+		{
+			#natures_vigil
+			Spell(natures_vigil)
+
+			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)
+			}
+		}
+	}
+}
+
+### actions.precombat
+
+AddFunction GuardianPrecombatMainActions
 {
 	#flask,type=greater_draenic_agility_flask
 	#food,type=sleeper_surprise
@@ -112,16 +136,39 @@ AddFunction GuardianPrecombatActions
 	Spell(cenarion_ward)
 }

+### Guardian icons.
+AddCheckBox(opt_druid_guardian_aoe L(AOE) specialization=guardian default)
+
+AddIcon specialization=guardian help=shortcd enemies=1 checkbox=!opt_druid_guardian_aoe
+{
+	GuardianDefaultShortCdActions()
+}
+
+AddIcon specialization=guardian help=shortcd checkbox=opt_druid_guardian_aoe
+{
+	GuardianDefaultShortCdActions()
+}
+
 AddIcon specialization=guardian help=main enemies=1
 {
-	if not InCombat() GuardianPrecombatActions()
-	GuardianDefaultActions()
+	if not InCombat() GuardianPrecombatMainActions()
+	GuardianDefaultMainActions()
+}
+
+AddIcon specialization=guardian help=aoe checkbox=opt_druid_guardian_aoe
+{
+	if not InCombat() GuardianPrecombatMainActions()
+	GuardianDefaultMainActions()
+}
+
+AddIcon specialization=guardian help=cd enemies=1 checkbox=!opt_druid_guardian_aoe
+{
+	GuardianDefaultCdActions()
 }

-AddIcon specialization=guardian help=aoe
+AddIcon specialization=guardian help=cd checkbox=opt_druid_guardian_aoe
 {
-	if not InCombat() GuardianPrecombatActions()
-	GuardianDefaultActions()
+	GuardianDefaultCdActions()
 }

 ### Required symbols
@@ -166,6 +213,7 @@ AddIcon specialization=guardian help=aoe
 # tooth_and_claw_buff
 # typhoon
 # war_stomp
+# wild_charge
 # wild_charge_bear
 # wild_charge_cat
 ]]
diff --git a/scripts/simulationcraft_hunter_bm.lua b/scripts/simulationcraft_hunter_bm.lua
index 89b92bf..a9915e0 100644
--- a/scripts/simulationcraft_hunter_bm.lua
+++ b/scripts/simulationcraft_hunter_bm.lua
@@ -41,37 +41,12 @@ AddFunction BeastMasterySummonPet
 	if pet.IsDead() Spell(revive_pet)
 }

-AddFunction BeastMasteryDefaultActions
+### actions.default
+
+AddFunction BeastMasteryDefaultMainActions
 {
-	#auto_shot
-	#arcane_torrent,if=focus.deficit>=30
-	if FocusDeficit() >= 30 Spell(arcane_torrent_focus)
-	#blood_fury
-	Spell(blood_fury_ap)
-	#berserking
-	Spell(berserking)
-	#potion,name=draenic_agility,if=!talent.stampede.enabled&buff.bestial_wrath.up&target.health.pct<=20|target.time_to_die<=20
-	if not Talent(stampede_talent) and BuffPresent(bestial_wrath_buff) and target.HealthPercent() <= 20 or target.TimeToDie() <= 20 UsePotionAgility()
-	#potion,name=draenic_agility,if=talent.stampede.enabled&cooldown.stampede.remains<1&(buff.bloodlust.up|buff.focus_fire.up)|target.time_to_die<=25
-	if Talent(stampede_talent) and SpellCooldown(stampede) < 1 and { BuffPresent(burst_haste_buff any=1) or BuffPresent(focus_fire_buff) } or target.TimeToDie() <= 25 UsePotionAgility()
-	#stampede,if=buff.bloodlust.up|buff.focus_fire.up|target.time_to_die<=25
-	if BuffPresent(burst_haste_buff any=1) or BuffPresent(focus_fire_buff) or target.TimeToDie() <= 25 Spell(stampede)
-	#dire_beast
-	Spell(dire_beast)
-	#explosive_trap,if=active_enemies>1
-	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>1
-	if Enemies() > 1 Spell(barrage)
 	#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)
-	#focus_fire,five_stacks=1
-	if BuffStacks(frenzy_buff any=1) == 5 Spell(focus_fire)
-	#barrage,if=active_enemies>1
-	if Enemies() > 1 Spell(barrage)
-	#a_murder_of_crows
-	Spell(a_murder_of_crows)
 	#kill_shot,if=focus.time_to_max>gcd
 	if TimeToMaxFocus() > GCD() Spell(kill_shot)
 	#kill_command
@@ -82,10 +57,6 @@ AddFunction BeastMasteryDefaultActions
 	if BuffPresent(pre_steady_focus_buff) and 14 + FocusCastingRegen(cobra_shot) <= FocusDeficit() Spell(cobra_shot)
 	#glaive_toss
 	Spell(glaive_toss)
-	#barrage
-	Spell(barrage)
-	#powershot,if=focus.time_to_max>cast_time
-	if TimeToMaxFocus() > CastTime(powershot) Spell(powershot)
 	#cobra_shot,if=active_enemies>5
 	if Enemies() > 5 Spell(cobra_shot)
 	#arcane_shot,if=(buff.thrill_of_the_hunt.react&focus>35)|buff.bestial_wrath.up
@@ -96,31 +67,122 @@ AddFunction BeastMasteryDefaultActions
 	Spell(cobra_shot)
 }

-AddFunction BeastMasteryPrecombatActions
+AddFunction BeastMasteryDefaultShortCdActions
+{
+	#dire_beast
+	Spell(dire_beast)
+	#explosive_trap,if=active_enemies>1
+	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>1
+	if Enemies() > 1 Spell(barrage)
+
+	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)
+		#barrage,if=active_enemies>1
+		if Enemies() > 1 Spell(barrage)
+		#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)
+		{
+			#barrage
+			Spell(barrage)
+			#powershot,if=focus.time_to_max>cast_time
+			if TimeToMaxFocus() > CastTime(powershot) Spell(powershot)
+		}
+	}
+}
+
+AddFunction BeastMasteryDefaultCdActions
+{
+	#auto_shot
+	#arcane_torrent,if=focus.deficit>=30
+	if FocusDeficit() >= 30 Spell(arcane_torrent_focus)
+	#blood_fury
+	Spell(blood_fury_ap)
+	#berserking
+	Spell(berserking)
+	#potion,name=draenic_agility,if=!talent.stampede.enabled&buff.bestial_wrath.up&target.health.pct<=20|target.time_to_die<=20
+	if not Talent(stampede_talent) and BuffPresent(bestial_wrath_buff) and target.HealthPercent() <= 20 or target.TimeToDie() <= 20 UsePotionAgility()
+	#potion,name=draenic_agility,if=talent.stampede.enabled&cooldown.stampede.remains<1&(buff.bloodlust.up|buff.focus_fire.up)|target.time_to_die<=25
+	if Talent(stampede_talent) and SpellCooldown(stampede) < 1 and { BuffPresent(burst_haste_buff any=1) or BuffPresent(focus_fire_buff) } or target.TimeToDie() <= 25 UsePotionAgility()
+	#stampede,if=buff.bloodlust.up|buff.focus_fire.up|target.time_to_die<=25
+	if BuffPresent(burst_haste_buff any=1) or BuffPresent(focus_fire_buff) or target.TimeToDie() <= 25 Spell(stampede)
+}
+
+### actions.precombat
+
+AddFunction BeastMasteryPrecombatMainActions
 {
-	#flask,type=greater_draenic_agility_flask
-	#food,type=blackrock_barbecue
-	#summon_pet
-	BeastMasterySummonPet()
 	#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)
-	#potion,name=draenic_agility
-	UsePotionAgility()
+	#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 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()
+	}
+}
+
+### 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 not InCombat() BeastMasteryPrecombatShortCdActions()
+	BeastMasteryDefaultShortCdActions()
+}
+
+AddIcon specialization=beast_mastery help=shortcd checkbox=opt_hunter_beast_mastery_aoe
+{
+	if not InCombat() BeastMasteryPrecombatShortCdActions()
+	BeastMasteryDefaultShortCdActions()
 }

 AddIcon specialization=beast_mastery help=main enemies=1
 {
-	if not InCombat() BeastMasteryPrecombatActions()
-	BeastMasteryDefaultActions()
+	if not InCombat() BeastMasteryPrecombatMainActions()
+	BeastMasteryDefaultMainActions()
+}
+
+AddIcon specialization=beast_mastery help=aoe checkbox=opt_hunter_beast_mastery_aoe
+{
+	if not InCombat() BeastMasteryPrecombatMainActions()
+	BeastMasteryDefaultMainActions()
+}
+
+AddIcon specialization=beast_mastery help=cd enemies=1 checkbox=!opt_hunter_beast_mastery_aoe
+{
+	if not InCombat() BeastMasteryPrecombatCdActions()
+	BeastMasteryDefaultCdActions()
 }

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

 ### Required symbols
@@ -136,13 +198,13 @@ AddIcon specialization=beast_mastery help=aoe
 # counter_shot
 # dire_beast
 # draenic_agility_potion
-# exotic_munitions_buff
 # explosive_trap
 # focus_fire
 # focus_fire_buff
 # focusing_shot
 # frenzy_buff
 # glaive_toss
+# glaive_toss_talent
 # glyph_of_explosive_trap
 # incendiary_ammo
 # kill_command
diff --git a/scripts/simulationcraft_hunter_mm.lua b/scripts/simulationcraft_hunter_mm.lua
index 5fd8188..eea852e 100644
--- a/scripts/simulationcraft_hunter_mm.lua
+++ b/scripts/simulationcraft_hunter_mm.lua
@@ -8,7 +8,7 @@ do
 # Based on SimulationCraft profile "Hunter_MM_T17M".
 #	class=hunter
 #	spec=marksmanship
-#	talents=0003113
+#	talents=0003313

 Include(ovale_common)
 Include(ovale_hunter_spells)
@@ -51,41 +51,18 @@ AddFunction SummonPet
 	}
 }

-AddFunction MarksmanshipDefaultActions
+### actions.default
+
+AddFunction MarksmanshipDefaultMainActions
 {
-	#auto_shot
-	#use_item,name=beating_heart_of_the_mountain
-	UseItemActions()
-	#arcane_torrent,if=focus.deficit>=30
-	if FocusDeficit() >= 30 Spell(arcane_torrent_focus)
-	#blood_fury
-	Spell(blood_fury_ap)
-	#berserking
-	Spell(berserking)
-	#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()
 	#chimaera_shot
 	Spell(chimaera_shot)
 	#kill_shot
 	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) MarksmanshipCarefulAimActions()
-	#explosive_trap,if=active_enemies>1
-	if Enemies() > 1 and CheckBoxOn(opt_trap_launcher) and not Glyph(glyph_of_explosive_trap) Spell(explosive_trap)
-	#a_murder_of_crows
-	Spell(a_murder_of_crows)
-	#dire_beast,if=cast_regen+action.aimed_shot.cast_regen<focus.deficit
-	if FocusCastingRegen(dire_beast) + FocusCastingRegen(aimed_shot) < FocusDeficit() Spell(dire_beast)
+	if target.HealthPercent() > 80 or BuffPresent(rapid_fire_buff) MarksmanshipCarefulAimMainActions()
 	#glaive_toss
 	Spell(glaive_toss)
-	#powershot,if=cast_regen<focus.deficit
-	if FocusCastingRegen(powershot) < FocusDeficit() Spell(powershot)
-	#barrage
-	Spell(barrage)
 	#steady_shot,if=focus.deficit*cast_time%(14+cast_regen)>cooldown.rapid_fire.remains
 	if FocusDeficit() * CastTime(steady_shot) / { 14 + FocusCastingRegen(steady_shot) } > SpellCooldown(rapid_fire) Spell(steady_shot)
 	#focusing_shot,if=focus.deficit*cast_time%(50+cast_regen)>cooldown.rapid_fire.remains&focus<100
@@ -106,14 +83,58 @@ AddFunction MarksmanshipDefaultActions
 	Spell(steady_shot)
 }

-AddFunction MarksmanshipCarefulAimActions
+AddFunction MarksmanshipDefaultShortCdActions
+{
+	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()
+		#explosive_trap,if=active_enemies>1
+		if Enemies() > 1 and CheckBoxOn(opt_trap_launcher) and not Glyph(glyph_of_explosive_trap) Spell(explosive_trap)
+		#a_murder_of_crows
+		Spell(a_murder_of_crows)
+		#dire_beast,if=cast_regen+action.aimed_shot.cast_regen<focus.deficit
+		if FocusCastingRegen(dire_beast) + FocusCastingRegen(aimed_shot) < FocusDeficit() Spell(dire_beast)
+
+		unless Spell(glaive_toss)
+		{
+			#powershot,if=cast_regen<focus.deficit
+			if FocusCastingRegen(powershot) < FocusDeficit() Spell(powershot)
+			#barrage
+			Spell(barrage)
+		}
+	}
+}
+
+AddFunction MarksmanshipDefaultCdActions
+{
+	#auto_shot
+	#use_item,name=beating_heart_of_the_mountain
+	UseItemActions()
+	#arcane_torrent,if=focus.deficit>=30
+	if FocusDeficit() >= 30 Spell(arcane_torrent_focus)
+	#blood_fury
+	Spell(blood_fury_ap)
+	#berserking
+	Spell(berserking)
+	#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 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)
+	}
+}
+
+### actions.careful_aim
+
+AddFunction MarksmanshipCarefulAimMainActions
 {
 	#glaive_toss,if=active_enemies>2
 	if Enemies() > 2 Spell(glaive_toss)
-	#powershot,if=active_enemies>1&cast_regen<focus.deficit
-	if Enemies() > 1 and FocusCastingRegen(powershot) < FocusDeficit() Spell(powershot)
-	#barrage,if=active_enemies>1
-	if Enemies() > 1 Spell(barrage)
 	#aimed_shot
 	Spell(aimed_shot)
 	#focusing_shot,if=50+cast_regen<focus.deficit
@@ -122,33 +143,86 @@ AddFunction MarksmanshipCarefulAimActions
 	Spell(steady_shot)
 }

-AddFunction MarksmanshipPrecombatActions
+AddFunction MarksmanshipCarefulAimShortCdActions
+{
+	unless Enemies() > 2 and Spell(glaive_toss)
+	{
+		#powershot,if=active_enemies>1&cast_regen<focus.deficit
+		if Enemies() > 1 and FocusCastingRegen(powershot) < FocusDeficit() Spell(powershot)
+		#barrage,if=active_enemies>1
+		if Enemies() > 1 Spell(barrage)
+	}
+}
+
+### actions.precombat
+
+AddFunction MarksmanshipPrecombatMainActions
 {
-	#flask,type=greater_draenic_agility_flask
-	#food,type=blackrock_barbecue
-	#summon_pet
-	SummonPet()
 	#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)
-	#potion,name=draenic_agility
-	UsePotionAgility()
-	#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 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()
+	}
+}
+
+### 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 not InCombat() MarksmanshipPrecombatShortCdActions()
+	MarksmanshipDefaultShortCdActions()
+}
+
+AddIcon specialization=marksmanship help=shortcd checkbox=opt_hunter_marksmanship_aoe
+{
+	if not InCombat() MarksmanshipPrecombatShortCdActions()
+	MarksmanshipDefaultShortCdActions()
 }

 AddIcon specialization=marksmanship help=main enemies=1
 {
-	if not InCombat() MarksmanshipPrecombatActions()
-	MarksmanshipDefaultActions()
+	if not InCombat() MarksmanshipPrecombatMainActions()
+	MarksmanshipDefaultMainActions()
+}
+
+AddIcon specialization=marksmanship help=aoe checkbox=opt_hunter_marksmanship_aoe
+{
+	if not InCombat() MarksmanshipPrecombatMainActions()
+	MarksmanshipDefaultMainActions()
+}
+
+AddIcon specialization=marksmanship help=cd enemies=1 checkbox=!opt_hunter_marksmanship_aoe
+{
+	if not InCombat() MarksmanshipPrecombatCdActions()
+	MarksmanshipDefaultCdActions()
 }

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

 ### Required symbols
@@ -162,11 +236,11 @@ AddIcon specialization=marksmanship help=aoe
 # counter_shot
 # dire_beast
 # draenic_agility_potion
-# exotic_munitions_buff
 # explosive_trap
 # focusing_shot_marksmanship
 # focusing_shot_talent
 # glaive_toss
+# glaive_toss_talent
 # glyph_of_explosive_trap
 # incendiary_ammo
 # kill_shot
diff --git a/scripts/simulationcraft_hunter_sv.lua b/scripts/simulationcraft_hunter_sv.lua
index 0da055a..d881f00 100644
--- a/scripts/simulationcraft_hunter_sv.lua
+++ b/scripts/simulationcraft_hunter_sv.lua
@@ -8,7 +8,7 @@ do
 # Based on SimulationCraft profile "Hunter_SV_T17M".
 #	class=hunter
 #	spec=survival
-#	talents=0003123
+#	talents=0001112

 Include(ovale_common)
 Include(ovale_hunter_spells)
@@ -51,7 +51,49 @@ AddFunction SummonPet
 	}
 }

-AddFunction SurvivalDefaultActions
+### actions.default
+
+AddFunction SurvivalDefaultMainActions
+{
+	#call_action_list,name=aoe,if=active_enemies>1
+	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)
+	#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
+	if Focus() >= 80 or Talent(focusing_shot_talent) Spell(arcane_shot)
+	#focusing_shot
+	Spell(focusing_shot)
+	#cobra_shot
+	Spell(cobra_shot)
+}
+
+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 Spell(explosive_shot)
+	{
+		#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) <= 3 or target.TimeToDie() < 4.5 } and Spell(arcane_shot)
+		{
+			#explosive_trap
+			if CheckBoxOn(opt_trap_launcher) and not Glyph(glyph_of_explosive_trap) Spell(explosive_trap)
+		}
+	}
+}
+
+AddFunction SurvivalDefaultCdActions
 {
 	#auto_shot
 	#use_item,name=beating_heart_of_the_mountain
@@ -65,59 +107,23 @@ AddFunction SurvivalDefaultActions
 	#potion,name=draenic_agility,if=(((cooldown.stampede.remains<1)&(cooldown.a_murder_of_crows.remains<1))&(trinket.stat.any.up|buff.archmages_greater_incandescence_agi.up))|target.time_to_die<=25
 	if SpellCooldown(stampede) < 1 and SpellCooldown(a_murder_of_crows) < 1 and { BuffPresent(trinket_stat_any_buff) or BuffPresent(archmages_greater_incandescence_agi_buff) } or target.TimeToDie() <= 25 UsePotionAgility()
 	#call_action_list,name=aoe,if=active_enemies>1
-	if Enemies() > 1 SurvivalAoeActions()
+	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(draenic_agility_potion) > 0 and { BuffPresent(archmages_greater_incandescence_agi_buff) or BuffPresent(trinket_stat_any_buff) } or target.TimeToDie() <= 25 Spell(stampede)
-	#black_arrow,if=!ticking
-	if not target.DebuffPresent(black_arrow_debuff) Spell(black_arrow)
-	#explosive_shot
-	Spell(explosive_shot)
-	#a_murder_of_crows
-	Spell(a_murder_of_crows)
-	#dire_beast
-	Spell(dire_beast)
-	#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)
-	#powershot
-	Spell(powershot)
-	#barrage
-	Spell(barrage)
-	#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
-	if Focus() >= 80 or Talent(focusing_shot_talent) Spell(arcane_shot)
-	#focusing_shot
-	Spell(focusing_shot)
-	#cobra_shot
-	Spell(cobra_shot)
 }

-AddFunction SurvivalAoeActions
+### actions.aoe
+
+AddFunction SurvivalAoeMainActions
 {
-	#stampede,if=buff.potion.up|(cooldown.potion.remains&(buff.archmages_greater_incandescence_agi.up|trinket.stat.any.up|buff.archmages_incandescence_agi.up))
-	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)
 	#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)
-	#barrage
-	Spell(barrage)
-	#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)
-	#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)
-	#a_murder_of_crows
-	Spell(a_murder_of_crows)
-	#dire_beast
-	Spell(dire_beast)
 	#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
 	if 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 Spell(multishot)
 	#glaive_toss
 	Spell(glaive_toss)
-	#powershot
-	Spell(powershot)
 	#cobra_shot,if=buff.pre_steady_focus.up&buff.steady_focus.remains<5&focus+14+cast_regen<80
 	if BuffPresent(pre_steady_focus_buff) and BuffRemaining(steady_focus_buff) < 5 and Focus() + 14 + FocusCastingRegen(cobra_shot) < 80 Spell(cobra_shot)
 	#multishot,if=focus>=70|talent.focusing_shot.enabled
@@ -128,31 +134,108 @@ AddFunction SurvivalAoeActions
 	Spell(cobra_shot)
 }

-AddFunction SurvivalPrecombatActions
+AddFunction SurvivalAoeShortCdActions
+{
+	unless BuffPresent(lock_and_load_buff) and { not Talent(barrage_talent) or SpellCooldown(barrage) > 0 } and Spell(explosive_shot)
+	{
+		#barrage
+		Spell(barrage)
+		#black_arrow,if=!ticking
+		if not target.DebuffPresent(black_arrow_debuff) Spell(black_arrow)
+
+		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)
+			#a_murder_of_crows
+			Spell(a_murder_of_crows)
+			#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)
+			{
+				#powershot
+				Spell(powershot)
+			}
+		}
+	}
+}
+
+AddFunction SurvivalAoeCdActions
+{
+	#stampede,if=buff.potion.up|(cooldown.potion.remains&(buff.archmages_greater_incandescence_agi.up|trinket.stat.any.up|buff.archmages_incandescence_agi.up))
+	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)
+}
+
+### actions.precombat
+
+AddFunction SurvivalPrecombatMainActions
 {
-	#flask,type=greater_draenic_agility_flask
-	#food,type=blackrock_barbecue
-	#summon_pet
-	SummonPet()
 	#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)
-	#potion,name=draenic_agility
-	UsePotionAgility()
+	#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 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()
+	}
+}
+
+### 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 not InCombat() SurvivalPrecombatShortCdActions()
+	SurvivalDefaultShortCdActions()
+}
+
+AddIcon specialization=survival help=shortcd checkbox=opt_hunter_survival_aoe
+{
+	if not InCombat() SurvivalPrecombatShortCdActions()
+	SurvivalDefaultShortCdActions()
 }

 AddIcon specialization=survival help=main enemies=1
 {
-	if not InCombat() SurvivalPrecombatActions()
-	SurvivalDefaultActions()
+	if not InCombat() SurvivalPrecombatMainActions()
+	SurvivalDefaultMainActions()
+}
+
+AddIcon specialization=survival help=aoe checkbox=opt_hunter_survival_aoe
+{
+	if not InCombat() SurvivalPrecombatMainActions()
+	SurvivalDefaultMainActions()
+}
+
+AddIcon specialization=survival help=cd enemies=1 checkbox=!opt_hunter_survival_aoe
+{
+	if not InCombat() SurvivalPrecombatCdActions()
+	SurvivalDefaultCdActions()
 }

-AddIcon specialization=survival help=aoe
+AddIcon specialization=survival help=cd checkbox=opt_hunter_survival_aoe
 {
-	if not InCombat() SurvivalPrecombatActions()
-	SurvivalDefaultActions()
+	if not InCombat() SurvivalPrecombatCdActions()
+	SurvivalDefaultCdActions()
 }

 ### Required symbols
@@ -171,20 +254,19 @@ AddIcon specialization=survival help=aoe
 # counter_shot
 # dire_beast
 # draenic_agility_potion
-# exotic_munitions_buff
 # explosive_shot
 # explosive_trap
 # explosive_trap_debuff
 # focusing_shot
 # focusing_shot_talent
 # glaive_toss
+# glaive_toss_talent
 # glyph_of_explosive_trap
 # incendiary_ammo
 # lock_and_load_buff
 # lone_wolf_talent
 # multishot
 # poisoned_ammo
-# potion_agility_buff
 # powershot
 # pre_steady_focus_buff
 # quaking_palm
diff --git a/scripts/simulationcraft_mage_arcane.lua b/scripts/simulationcraft_mage_arcane.lua
index 6e5f0a1..adb0acf 100644
--- a/scripts/simulationcraft_mage_arcane.lua
+++ b/scripts/simulationcraft_mage_arcane.lua
@@ -8,7 +8,7 @@ do
 # Based on SimulationCraft profile "Mage_Arcane_T17M".
 #	class=mage
 #	spec=arcane
-#	talents=3003121
+#	talents=3003123
 #	glyphs=arcane_power/cone_of_cold

 Include(ovale_common)
@@ -35,60 +35,114 @@ AddFunction InterruptActions
 	}
 }

-AddFunction ArcaneDefaultActions
+### actions.default
+
+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 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) ArcaneCrystalSequenceMainActions()
+	#call_action_list,name=aoe,if=active_enemies>=4
+	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() } ArcaneBurnMainActions()
+	#call_action_list,name=conserve
+	ArcaneConserveMainActions()
+}
+
+AddFunction ArcaneDefaultShortCdActions
 {
-	#counterspell,if=target.debuff.casting.react
-	if target.IsInterruptible() InterruptActions()
 	#blink,if=movement.distance>10
 	if 0 > 10 Spell(blink)
 	#blazing_speed,if=movement.remains>0
 	if 0 > 0 Spell(blazing_speed)
-	#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)
 	#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
 	if TotemRemaining(rune_of_power) < CastTime(rune_of_power) 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 ArcaneInitCrystalActions()
+	if Talent(prismatic_crystal_talent) and not SpellCooldown(prismatic_crystal) > 0 ArcaneInitCrystalShortCdActions()
 	#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) ArcaneCrystalSequenceShortCdActions()
 	#call_action_list,name=aoe,if=active_enemies>=4
-	if Enemies() >= 4 ArcaneAoeActions()
+	if Enemies() >= 4 ArcaneAoeShortCdActions()
 	#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() } ArcaneBurnShortCdActions()
 	#call_action_list,name=conserve
-	ArcaneConserveActions()
+	ArcaneConserveShortCdActions()
 }

-AddFunction ArcaneAoeActions
+AddFunction ArcaneDefaultCdActions
+{
+	#counterspell,if=target.debuff.casting.react
+	if target.IsInterruptible() InterruptActions()
+
+	unless 0 > 10 and Spell(blink)
+	{
+		#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()
+		}
+	}
+}
+
+### actions.aoe
+
+AddFunction ArcaneAoeMainActions
 {
-	#call_action_list,name=cooldowns
-	ArcaneCooldownsActions()
 	#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)
 	#supernova
 	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 ArcaneBurnActions
+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
 {
 	#call_action_list,name=cooldowns
-	ArcaneCooldownsActions()
+	ArcaneCooldownsCdActions()
+}
+
+### actions.burn
+
+AddFunction ArcaneBurnMainActions
+{
 	#arcane_missiles,if=buff.arcane_missiles.react=3
 	if BuffStacks(arcane_missiles_buff) == 3 and BuffPresent(arcane_missiles_buff) Spell(arcane_missiles)
 	#arcane_missiles,if=set_bonus.tier17_4pc&buff.arcane_instability.react&buff.arcane_instability.remains<action.arcane_blast.execute_time
@@ -97,32 +151,58 @@ 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)
-	#presence_of_mind,if=mana.pct>96
-	if ManaPercent() > 96 Spell(presence_of_mind)
 	#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()
-	#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)
+	if SpellCooldownDuration(evocation) - SpellCooldown(evocation) < 5 ArcaneConserveMainActions()
 	#arcane_blast
 	Spell(arcane_blast)
 }

-AddFunction ArcaneConserveActions
+AddFunction ArcaneBurnShortCdActions
+{
+	#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 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 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)
+		}
+	}
+}
+
+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 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)
+	}
+}
+
+### actions.conserve
+
+AddFunction ArcaneConserveMainActions
 {
-	#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 } ArcaneCooldownsActions()
 	#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)
 	#arcane_missiles,if=set_bonus.tier17_4pc&buff.arcane_instability.react&buff.arcane_instability.remains<action.arcane_blast.execute_time
@@ -131,10 +211,6 @@ AddFunction ArcaneConserveActions
 	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)
 	#supernova,if=time_to_die<8|(charges=2&(buff.arcane_power.up|!cooldown.arcane_power.up)&(!talent.prismatic_crystal.enabled|cooldown.prismatic_crystal.remains>8))
 	if 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 } 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)
 	#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&(!talent.overpowered.enabled|cooldown.arcane_power.remains>10*spell_haste)
@@ -142,21 +218,51 @@ 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)
-	#presence_of_mind,if=buff.arcane_charge.stack<2
-	if DebuffStacks(arcane_charge_debuff) < 2 Spell(presence_of_mind)
 	#arcane_blast
 	Spell(arcane_blast)
 	#arcane_barrage,moving=1
 	if Speed() > 0 Spell(arcane_barrage)
 }

-AddFunction ArcaneCooldownsActions
+AddFunction ArcaneConserveShortCdActions
+{
+	#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&(!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&(!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)
+		}
+	}
+}
+
+AddFunction ArcaneConserveCdActions
+{
+	#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 } ArcaneCooldownsCdActions()
+}
+
+### actions.cooldowns
+
+AddFunction ArcaneCooldownsShortCdActions
 {
 	#arcane_power
 	Spell(arcane_power)
+}
+
+AddFunction ArcaneCooldownsCdActions
+{
 	#blood_fury
 	Spell(blood_fury_sp)
 	#berserking
@@ -167,53 +273,137 @@ AddFunction ArcaneCooldownsActions
 	if BuffPresent(arcane_power_buff) and { not Talent(prismatic_crystal_talent) or TotemPresent(prismatic_crystal) } UsePotionIntellect()
 }

-AddFunction ArcaneCrystalSequenceActions
+### actions.crystal_sequence
+
+AddFunction ArcaneCrystalSequenceMainActions
 {
-	#call_action_list,name=cooldowns
-	ArcaneCooldownsActions()
 	#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(prismatic_crystal) > 8 Spell(nether_tempest)
-	#call_action_list,name=burn
-	ArcaneBurnActions()
+	#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
+{
+	#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)
+	{
+		#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)
+	}
+}
+
+AddFunction ArcaneCrystalSequenceCdActions
+{
+	#call_action_list,name=cooldowns
+	ArcaneCooldownsCdActions()
+}
+
+### actions.init_crystal
+
+AddFunction ArcaneInitCrystalMainActions
+{
+	#call_action_list,name=conserve,if=buff.arcane_charge.stack<4
+	if DebuffStacks(arcane_charge_debuff) < 4 ArcaneConserveMainActions()
 }

-AddFunction ArcaneInitCrystalActions
+AddFunction ArcaneInitCrystalShortCdActions
 {
 	#call_action_list,name=conserve,if=buff.arcane_charge.stack<4
-	if DebuffStacks(arcane_charge_debuff) < 4 ArcaneConserveActions()
+	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
+{
+	#call_action_list,name=conserve,if=buff.arcane_charge.stack<4
+	if DebuffStacks(arcane_charge_debuff) < 4 ArcaneConserveCdActions()
 }

-AddFunction ArcanePrecombatActions
+### actions.precombat
+
+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
-	#rune_of_power
-	Spell(rune_of_power)
-	#mirror_image
-	Spell(mirror_image)
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#arcane_blast
 	Spell(arcane_blast)
 }

+AddFunction ArcanePrecombatShortCdActions
+{
+	unless { BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) } and Spell(arcane_brilliance)
+	{
+		#snapshot_stats
+		#rune_of_power
+		Spell(rune_of_power)
+	}
+}
+
+AddFunction ArcanePrecombatCdActions
+{
+	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)
+		#potion,name=draenic_intellect
+		UsePotionIntellect()
+	}
+}
+
+### Arcane icons.
+AddCheckBox(opt_mage_arcane_aoe L(AOE) specialization=arcane default)
+
+AddIcon specialization=arcane help=shortcd enemies=1 checkbox=!opt_mage_arcane_aoe
+{
+	if not InCombat() ArcanePrecombatShortCdActions()
+	ArcaneDefaultShortCdActions()
+}
+
+AddIcon specialization=arcane help=shortcd checkbox=opt_mage_arcane_aoe
+{
+	if not InCombat() ArcanePrecombatShortCdActions()
+	ArcaneDefaultShortCdActions()
+}
+
 AddIcon specialization=arcane help=main enemies=1
 {
-	if not InCombat() ArcanePrecombatActions()
-	ArcaneDefaultActions()
+	if not InCombat() ArcanePrecombatMainActions()
+	ArcaneDefaultMainActions()
+}
+
+AddIcon specialization=arcane help=aoe checkbox=opt_mage_arcane_aoe
+{
+	if not InCombat() ArcanePrecombatMainActions()
+	ArcaneDefaultMainActions()
+}
+
+AddIcon specialization=arcane help=cd enemies=1 checkbox=!opt_mage_arcane_aoe
+{
+	if not InCombat() ArcanePrecombatCdActions()
+	ArcaneDefaultCdActions()
 }

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

 ### Required symbols
diff --git a/scripts/simulationcraft_mage_fire.lua b/scripts/simulationcraft_mage_fire.lua
index 47415b5..dcb7952 100644
--- a/scripts/simulationcraft_mage_fire.lua
+++ b/scripts/simulationcraft_mage_fire.lua
@@ -35,80 +35,135 @@ AddFunction InterruptActions
 	}
 }

-AddFunction FireDefaultActions
+### actions.default
+
+AddFunction FireDefaultMainActions
+{
+	#call_action_list,name=combust_sequence,if=pyro_chain
+	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) FireCrystalSequenceMainActions()
+	#call_action_list,name=init_combust,if=!pyro_chain
+	if not GetState(pyro_chain) > 0 FireInitCombustMainActions()
+	#call_action_list,name=aoe,if=active_enemies>=4
+	if Enemies() >= 4 FireAoeMainActions()
+	#call_action_list,name=single_target
+	FireSingleTargetMainActions()
+}
+
+AddFunction FireDefaultShortCdActions
 {
-	#counterspell,if=target.debuff.casting.react
-	if target.IsInterruptible() InterruptActions()
 	#blink,if=movement.distance>10
 	if 0 > 10 Spell(blink)
 	#blazing_speed,if=movement.remains>0
 	if 0 > 0 Spell(blazing_speed)
-	#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)
 	#ice_floes,if=buff.ice_floes.down&(raid_event.movement.distance>0|raid_event.movement.in<action.fireball.cast_time)
 	if BuffExpires(ice_floes_buff) and { 0 > 0 or 600 < CastTime(fireball) } 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)
 	#call_action_list,name=combust_sequence,if=pyro_chain
-	if GetState(pyro_chain) > 0 FireCombustSequenceActions()
+	if GetState(pyro_chain) > 0 FireCombustSequenceShortCdActions()
 	#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) FireCrystalSequenceShortCdActions()
 	#call_action_list,name=init_combust,if=!pyro_chain
-	if not GetState(pyro_chain) > 0 FireInitCombustActions()
+	if not GetState(pyro_chain) > 0 FireInitCombustShortCdActions()
 	#rune_of_power,if=buff.rune_of_power.remains<action.fireball.execute_time+gcd.max&!(buff.heating_up.up&action.fireball.in_flight)
 	if TotemRemaining(rune_of_power) < ExecuteTime(fireball) + GCD() and not { BuffPresent(heating_up_buff) and { InFlightToTarget(fireball) or InFlightToTarget(frostfire_bolt) } } 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 FireAoeActions()
+	if Enemies() >= 4 FireAoeShortCdActions()
 	#call_action_list,name=single_target
-	FireSingleTargetActions()
+	FireSingleTargetShortCdActions()
 }

-AddFunction FireActiveTalentsActions
+AddFunction FireDefaultCdActions
+{
+	#counterspell,if=target.debuff.casting.react
+	if target.IsInterruptible() InterruptActions()
+
+	unless 0 > 10 and Spell(blink)
+	{
+		#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)
+		{
+			#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()
+			}
+		}
+	}
+}
+
+### actions.active_talents
+
+AddFunction FireActiveTalentsMainActions
 {
-	#meteor,if=active_enemies>=5|(glyph.combustion.enabled&(!talent.incanters_flow.enabled|buff.incanters_flow.stack+incanters_flow_dir>=4)&cooldown.meteor.duration-cooldown.combustion.remains<10)
-	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)
 	#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)
 }

-AddFunction FireAoeActions
+AddFunction FireActiveTalentsShortCdActions
+{
+	#meteor,if=active_enemies>=5|(glyph.combustion.enabled&(!talent.incanters_flow.enabled|buff.incanters_flow.stack+incanters_flow_dir>=4)&cooldown.meteor.duration-cooldown.combustion.remains<10)
+	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)
+}
+
+### actions.aoe
+
+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
 	if not DebuffCountOnAny(pyroblast_debuff) > 0 and not InFlightToTarget(pyroblast) 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)
 	#dragons_breath,if=glyph.dragons_breath.enabled
 	if Glyph(glyph_of_dragons_breath) Spell(dragons_breath)
 	#flamestrike,if=mana.pct>10&remains<2.4
 	if ManaPercent() > 10 and target.DebuffRemaining(flamestrike_debuff) < 2.4 Spell(flamestrike)
 }

-AddFunction FireCombustSequenceActions
+AddFunction FireAoeShortCdActions
+{
+	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
+		FireActiveTalentsShortCdActions()
+	}
+}
+
+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)
+	{
+		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)
+		}
+	}
+}
+
+### actions.combust_sequence
+
+AddFunction FireCombustSequenceMainActions
 {
 	#stop_pyro_chain,if=cooldown.combustion.duration-cooldown.combustion.remains<15
 	if SpellCooldownDuration(combustion) - SpellCooldown(combustion) < 15 SetState(pyro_chain 0)
-	#prismatic_crystal
-	Spell(prismatic_crystal)
-	#blood_fury
-	Spell(blood_fury_sp)
-	#berserking
-	Spell(berserking)
-	#arcane_torrent
-	Spell(arcane_torrent_mana)
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
-	#meteor
-	Spell(meteor)
 	#pyroblast,if=set_bonus.tier17_4pc&buff.pyromaniac.up
 	if ArmorSetBonus(T17 4) and BuffPresent(pyromaniac_buff) Spell(pyroblast)
 	#inferno_blast,if=set_bonus.tier16_4pc_caster&(buff.pyroblast.up^buff.heating_up.up)
@@ -119,21 +174,78 @@ AddFunction FireCombustSequenceActions
 	if BuffPresent(pyroblast_buff) Spell(pyroblast)
 	#inferno_blast,if=talent.meteor.enabled&cooldown.meteor.duration-cooldown.meteor.remains<gcd.max*3
 	if Talent(meteor_talent) and SpellCooldownDuration(meteor) - SpellCooldown(meteor) < GCD() * 3 Spell(inferno_blast)
-	#combustion
-	Spell(combustion)
 }

-AddFunction FireCrystalSequenceActions
+AddFunction FireCombustSequenceShortCdActions
+{
+	#stop_pyro_chain,if=cooldown.combustion.duration-cooldown.combustion.remains<15
+	if SpellCooldownDuration(combustion) - SpellCooldown(combustion) < 15 SetState(pyro_chain 0)
+	#prismatic_crystal
+	Spell(prismatic_crystal)
+	#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)
+	{
+		#combustion
+		Spell(combustion)
+	}
+}
+
+AddFunction FireCombustSequenceCdActions
+{
+	#stop_pyro_chain,if=cooldown.combustion.duration-cooldown.combustion.remains<15
+	if SpellCooldownDuration(combustion) - SpellCooldown(combustion) < 15 SetState(pyro_chain 0)
+
+	unless Spell(prismatic_crystal)
+	{
+		#blood_fury
+		Spell(blood_fury_sp)
+		#berserking
+		Spell(berserking)
+		#arcane_torrent
+		Spell(arcane_torrent_mana)
+		#potion,name=draenic_intellect
+		UsePotionIntellect()
+	}
+}
+
+### actions.crystal_sequence
+
+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(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(prismatic_crystal) < GCD() + MaxTravelTime(pyroblast) and TotemRemaining(prismatic_crystal) > MaxTravelTime(pyroblast) and Spell(pyroblast)
+	{
+		#call_action_list,name=single_target
+		FireSingleTargetShortCdActions()
+	}
+}
+
+### actions.init_combust
+
+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)
+	#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 FireInitCombustActions
+AddFunction FireInitCombustShortCdActions
 {
 	#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)
@@ -142,10 +254,24 @@ 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 FireLivingBombActions
+AddFunction FireInitCombustCdActions
+{
+	#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)
+}
+
+### actions.living_bomb
+
+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)
@@ -153,24 +279,42 @@ 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)
 }

-AddFunction FirePrecombatActions
+### actions.precombat
+
+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
-	#rune_of_power
-	Spell(rune_of_power)
-	#mirror_image
-	Spell(mirror_image)
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#pyroblast
 	Spell(pyroblast)
 }

-AddFunction FireSingleTargetActions
+AddFunction FirePrecombatShortCdActions
+{
+	unless { BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) } and Spell(arcane_brilliance)
+	{
+		#snapshot_stats
+		#rune_of_power
+		Spell(rune_of_power)
+	}
+}
+
+AddFunction FirePrecombatCdActions
+{
+	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)
+		#potion,name=draenic_intellect
+		UsePotionIntellect()
+	}
+}
+
+### actions.single_target
+
+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)
@@ -185,7 +329,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
@@ -194,16 +338,52 @@ AddFunction FireSingleTargetActions
 	if Speed() > 0 Spell(scorch)
 }

+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)
+	{
+		#call_action_list,name=active_talents
+		FireActiveTalentsShortCdActions()
+	}
+}
+
+### Fire icons.
+AddCheckBox(opt_mage_fire_aoe L(AOE) specialization=fire default)
+
+AddIcon specialization=fire help=shortcd enemies=1 checkbox=!opt_mage_fire_aoe
+{
+	if not InCombat() FirePrecombatShortCdActions()
+	FireDefaultShortCdActions()
+}
+
+AddIcon specialization=fire help=shortcd checkbox=opt_mage_fire_aoe
+{
+	if not InCombat() FirePrecombatShortCdActions()
+	FireDefaultShortCdActions()
+}
+
 AddIcon specialization=fire help=main enemies=1
 {
-	if not InCombat() FirePrecombatActions()
-	FireDefaultActions()
+	if not InCombat() FirePrecombatMainActions()
+	FireDefaultMainActions()
+}
+
+AddIcon specialization=fire help=aoe checkbox=opt_mage_fire_aoe
+{
+	if not InCombat() FirePrecombatMainActions()
+	FireDefaultMainActions()
+}
+
+AddIcon specialization=fire help=cd enemies=1 checkbox=!opt_mage_fire_aoe
+{
+	if not InCombat() FirePrecombatCdActions()
+	FireDefaultCdActions()
 }

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

 ### Required symbols
diff --git a/scripts/simulationcraft_mage_frost.lua b/scripts/simulationcraft_mage_frost.lua
index 220e483..cc8dd22 100644
--- a/scripts/simulationcraft_mage_frost.lua
+++ b/scripts/simulationcraft_mage_frost.lua
@@ -35,53 +35,110 @@ AddFunction InterruptActions
 	}
 }

-AddFunction FrostDefaultActions
+### actions.default
+
+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) } FrostCrystalSequenceMainActions()
+	#call_action_list,name=aoe,if=active_enemies>=4
+	if Enemies() >= 4 FrostAoeMainActions()
+	#call_action_list,name=single_target
+	FrostSingleTargetMainActions()
+}
+
+AddFunction FrostDefaultShortCdActions
 {
-	#counterspell,if=target.debuff.casting.react
-	if target.IsInterruptible() InterruptActions()
 	#blink,if=movement.distance>10
 	if 0 > 10 Spell(blink)
 	#blazing_speed,if=movement.remains>0
 	if 0 > 0 Spell(blazing_speed)
-	#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)
+	#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)
 	#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)
-	#call_action_list,name=cooldowns,if=time_to_die<24
-	if TimeToDie() < 24 FrostCooldownsActions()
+	#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) } FrostCrystalSequenceActions()
+	if Talent(prismatic_crystal_talent) and { SpellCooldown(prismatic_crystal) <= GCD() or TotemPresent(prismatic_crystal) } FrostCrystalSequenceShortCdActions()
 	#call_action_list,name=aoe,if=active_enemies>=4
-	if Enemies() >= 4 FrostAoeActions()
+	if Enemies() >= 4 FrostAoeShortCdActions()
 	#call_action_list,name=single_target
-	FrostSingleTargetActions()
+	FrostSingleTargetShortCdActions()
 }

-AddFunction FrostAoeActions
+AddFunction FrostDefaultCdActions
+{
+	#counterspell,if=target.debuff.casting.react
+	if target.IsInterruptible() InterruptActions()
+
+	unless 0 > 10 and Spell(blink)
+	{
+		#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()
+		}
+	}
+}
+
+### actions.aoe
+
+AddFunction FrostAoeMainActions
 {
-	#call_action_list,name=cooldowns
-	FrostCooldownsActions()
 	#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)
-	#frozen_orb
-	Spell(frozen_orb)
 	#ice_lance,if=talent.frost_bomb.enabled&buff.fingers_of_frost.react&debuff.frost_bomb.up
 	if Talent(frost_bomb_talent) and BuffPresent(fingers_of_frost_buff) and target.DebuffPresent(frost_bomb_debuff) Spell(ice_lance)
-	#comet_storm
-	Spell(comet_storm)
 	#ice_nova
 	Spell(ice_nova)
 	#blizzard,interrupt_if=cooldown.frozen_orb.up|(talent.frost_bomb.enabled&buff.fingers_of_frost.react=2)
 	Spell(blizzard)
 }

-AddFunction FrostCooldownsActions
+AddFunction FrostAoeShortCdActions
+{
+	unless target.DebuffRemaining(frost_bomb_debuff) < MaxTravelTime(ice_lance) and { SpellCooldown(frozen_orb) < GCD() or BuffStacks(fingers_of_frost_buff) == 2 } and Spell(frost_bomb)
+	{
+		#frozen_orb
+		Spell(frozen_orb)
+
+		unless Talent(frost_bomb_talent) and BuffPresent(fingers_of_frost_buff) and target.DebuffPresent(frost_bomb_debuff) and Spell(ice_lance)
+		{
+			#comet_storm
+			Spell(comet_storm)
+		}
+	}
+}
+
+AddFunction FrostAoeCdActions
+{
+	#call_action_list,name=cooldowns
+	FrostCooldownsCdActions()
+}
+
+### actions.cooldowns
+
+AddFunction FrostCooldownsCdActions
 {
 	#icy_veins
 	Spell(icy_veins)
@@ -95,16 +152,12 @@ AddFunction FrostCooldownsActions
 	if BuffPresent(burst_haste_buff any=1) or BuffPresent(icy_veins_buff) UsePotionIntellect()
 }

-AddFunction FrostCrystalSequenceActions
+### actions.crystal_sequence
+
+AddFunction FrostCrystalSequenceMainActions
 {
 	#frost_bomb,if=active_enemies=1&current_target!=prismatic_crystal&remains<10
 	if Enemies() == 1 and not target.Name(prismatic_crystal) and target.DebuffRemaining(frost_bomb_debuff) < 10 Spell(frost_bomb)
-	#frozen_orb
-	Spell(frozen_orb)
-	#call_action_list,name=cooldowns
-	FrostCooldownsActions()
-	#prismatic_crystal
-	Spell(prismatic_crystal)
 	#frost_bomb,if=talent.prismatic_crystal.enabled&current_target=prismatic_crystal&active_enemies>1&!ticking
 	if Talent(prismatic_crystal_talent) and target.Name(prismatic_crystal) and Enemies() > 1 and not target.DebuffPresent(frost_bomb_debuff) Spell(frost_bomb)
 	#ice_lance,if=buff.fingers_of_frost.react=2|(buff.fingers_of_frost.react&active_dot.frozen_orb>=1)
@@ -123,45 +176,98 @@ AddFunction FrostCrystalSequenceActions
 	Spell(frostbolt)
 }

-AddFunction FrostPrecombatActions
+AddFunction FrostCrystalSequenceShortCdActions
+{
+	unless Enemies() == 1 and not target.Name(prismatic_crystal) and target.DebuffRemaining(frost_bomb_debuff) < 10 and Spell(frost_bomb)
+	{
+		#frozen_orb
+		Spell(frozen_orb)
+		#prismatic_crystal
+		Spell(prismatic_crystal)
+	}
+}
+
+AddFunction FrostCrystalSequenceCdActions
+{
+	unless Enemies() == 1 and not target.Name(prismatic_crystal) and target.DebuffRemaining(frost_bomb_debuff) < 10 and Spell(frost_bomb) or Spell(frozen_orb)
+	{
+		#call_action_list,name=cooldowns
+		FrostCooldownsCdActions()
+	}
+}
+
+### actions.init_water_jet
+
+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)
-	#water_elemental
-	if not pet.Present() Spell(water_elemental)
-	#snapshot_stats
-	#rune_of_power
-	Spell(rune_of_power)
-	#mirror_image
-	Spell(mirror_image)
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#frostbolt
 	Spell(frostbolt)
 }

-AddFunction FrostSingleTargetActions
+AddFunction FrostPrecombatShortCdActions
+{
+	unless { BuffExpires(critical_strike_buff any=1) or BuffExpires(spell_power_multiplier_buff any=1) } and Spell(arcane_brilliance)
+	{
+		#water_elemental
+		if not pet.Present() Spell(water_elemental)
+		#snapshot_stats
+		#rune_of_power
+		Spell(rune_of_power)
+	}
+}
+
+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 Spell(rune_of_power)
+	{
+		#mirror_image
+		Spell(mirror_image)
+		#potion,name=draenic_intellect
+		UsePotionIntellect()
+	}
+}
+
+### actions.single_target
+
+AddFunction FrostSingleTargetMainActions
 {
-	#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 FrostCooldownsActions()
 	#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)
 	#frostfire_bolt,if=buff.brain_freeze.react&buff.brain_freeze.remains<action.frostbolt.execute_time
 	if BuffPresent(brain_freeze_buff) and BuffRemaining(brain_freeze_buff) < ExecuteTime(frostbolt) Spell(frostfire_bolt)
 	#frost_bomb,if=!talent.prismatic_crystal.enabled&cooldown.frozen_orb.remains<gcd.max&debuff.frost_bomb.remains<10
 	if not Talent(prismatic_crystal_talent) and SpellCooldown(frozen_orb) < GCD() and target.DebuffRemaining(frost_bomb_debuff) < 10 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)
 	#frost_bomb,if=remains<action.ice_lance.travel_time&(buff.fingers_of_frost.react=2|(buff.fingers_of_frost.react&(talent.thermal_void.enabled|buff.fingers_of_frost.remains<gcd.max*2)))
 	if 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 } } Spell(frost_bomb)
 	#ice_nova,if=time_to_die<10|(charges=2&(!talent.prismatic_crystal.enabled|!cooldown.prismatic_crystal.up))
 	if TimeToDie() < 10 or Charges(ice_nova) == 2 and { not Talent(prismatic_crystal_talent) or not { not SpellCooldown(prismatic_crystal) > 0 } } Spell(ice_nova)
 	#ice_lance,if=buff.fingers_of_frost.react=2|(buff.fingers_of_frost.react&dot.frozen_orb.ticking)
 	if BuffStacks(fingers_of_frost_buff) == 2 or BuffPresent(fingers_of_frost_buff) and SpellCooldown(frozen_orb) > SpellCooldownDuration(frozen_orb) - 10 Spell(ice_lance)
-	#comet_storm
-	Spell(comet_storm)
 	#ice_nova,if=(!talent.prismatic_crystal.enabled|(charges=1&cooldown.prismatic_crystal.remains>recharge_time&buff.incanters_flow.stack>3))&(buff.icy_veins.up|(charges=1&cooldown.icy_veins.remains>recharge_time))
 	if { 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) } Spell(ice_nova)
 	#frostfire_bolt,if=buff.brain_freeze.react
@@ -174,24 +280,110 @@ 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)
-	#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 FrostInitWaterJetMainActions()
 	#frostbolt
 	Spell(frostbolt)
 	#ice_lance,moving=1
 	if Speed() > 0 Spell(ice_lance)
 }

+AddFunction FrostSingleTargetShortCdActions
+{
+	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) < 10 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)
+		{
+			#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)
+			{
+				#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()
+			}
+		}
+	}
+}
+
+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()
+	}
+}
+
+### Frost icons.
+AddCheckBox(opt_mage_frost_aoe L(AOE) specialization=frost default)
+
+AddIcon specialization=frost help=shortcd enemies=1 checkbox=!opt_mage_frost_aoe
+{
+	if not InCombat() FrostPrecombatShortCdActions()
+	FrostDefaultShortCdActions()
+}
+
+AddIcon specialization=frost help=shortcd checkbox=opt_mage_frost_aoe
+{
+	if not InCombat() FrostPrecombatShortCdActions()
+	FrostDefaultShortCdActions()
+}
+
 AddIcon specialization=frost help=main enemies=1
 {
-	if not InCombat() FrostPrecombatActions()
-	FrostDefaultActions()
+	if not InCombat() FrostPrecombatMainActions()
+	FrostDefaultMainActions()
+}
+
+AddIcon specialization=frost help=aoe checkbox=opt_mage_frost_aoe
+{
+	if not InCombat() FrostPrecombatMainActions()
+	FrostDefaultMainActions()
+}
+
+AddIcon specialization=frost help=cd enemies=1 checkbox=!opt_mage_frost_aoe
+{
+	if not InCombat() FrostPrecombatCdActions()
+	FrostDefaultCdActions()
 }

-AddIcon specialization=frost help=aoe
+AddIcon specialization=frost help=cd checkbox=opt_mage_frost_aoe
 {
-	if not InCombat() FrostPrecombatActions()
-	FrostDefaultActions()
+	if not InCombat() FrostPrecombatCdActions()
+	FrostDefaultCdActions()
 }

 ### Required symbols
@@ -218,6 +410,7 @@ AddIcon specialization=frost help=aoe
 # ice_floes_buff
 # ice_lance
 # ice_nova
+# ice_nova_talent
 # ice_shard_buff
 # icy_veins
 # icy_veins_buff
@@ -225,6 +418,7 @@ AddIcon specialization=frost help=aoe
 # mirror_image
 # mirror_image_talent
 # pet_water_jet
+# pet_water_jet_debuff
 # prismatic_crystal
 # prismatic_crystal_talent
 # quaking_palm
diff --git a/scripts/simulationcraft_monk_brewmaster_1h_ce.lua b/scripts/simulationcraft_monk_brewmaster_1h_ce.lua
index f043db3..9ad4a94 100644
--- a/scripts/simulationcraft_monk_brewmaster_1h_ce.lua
+++ b/scripts/simulationcraft_monk_brewmaster_1h_ce.lua
@@ -8,18 +8,18 @@ do
 # Based on SimulationCraft profile "Monk_Brewmaster_1h_CE_T17M".
 #	class=monk
 #	spec=brewmaster
-#	talents=0130222
+#	talents=2133112
 #	glyphs=fortifying_brew,expel_harm,fortuitous_spheres

 Include(ovale_common)
 Include(ovale_monk_spells)

-AddCheckBox(opt_potion_agility ItemName(draenic_agility_potion) default)
+AddCheckBox(opt_potion_armor ItemName(draenic_armor_potion) default)
 AddCheckBox(opt_chi_burst SpellName(chi_burst) default)

-AddFunction UsePotionAgility
+AddFunction UsePotionArmor
 {
-	if CheckBoxOn(opt_potion_agility) and target.Classification(worldboss) Item(draenic_agility_potion usable=1)
+	if CheckBoxOn(opt_potion_armor) and target.Classification(worldboss) Item(draenic_armor_potion usable=1)
 }

 AddFunction InterruptActions
@@ -37,7 +37,34 @@ AddFunction InterruptActions
 	}
 }

-AddFunction BrewmasterDefaultActions
+### actions.default
+
+AddFunction BrewmasterDefaultMainActions
+{
+	#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 BrewmasterStMainActions()
+	#call_action_list,name=aoe,if=active_enemies>=3
+	if Enemies() >= 3 BrewmasterAoeMainActions()
+}
+
+AddFunction BrewmasterDefaultShortCdActions
+{
+	#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&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
+	if Enemies() >= 3 BrewmasterAoeShortCdActions()
+}
+
+AddFunction BrewmasterDefaultCdActions
 {
 	#auto_attack
 	#blood_fury,if=energy<=40
@@ -46,8 +73,6 @@ AddFunction BrewmasterDefaultActions
 	if Energy() <= 40 Spell(berserking)
 	#arcane_torrent,if=energy<=40
 	if Energy() <= 40 Spell(arcane_torrent_chi)
-	#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
 	#diffuse_magic,if=incoming_damage_1500ms&buff.fortifying_brew.down
 	if IncomingDamage(1.5) > 0 and BuffExpires(fortifying_brew_buff) Spell(diffuse_magic)
@@ -55,121 +80,177 @@ AddFunction BrewmasterDefaultActions
 	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)
-	#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)
-	#invoke_xuen,if=talent.invoke_xuen.enabled&time>5
-	if Talent(invoke_xuen_talent) and TimeInCombat() > 5 Spell(invoke_xuen)
-	#serenity,if=talent.serenity.enabled&energy<=40
-	if Talent(serenity_talent) and Energy() <= 40 Spell(serenity)
-	#call_action_list,name=st,if=active_enemies<3
-	if Enemies() < 3 BrewmasterStActions()
-	#call_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 BrewmasterAoeActions()
+	#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()
 }

-AddFunction BrewmasterAoeActions
+### actions.aoe
+
+AddFunction BrewmasterAoeMainActions
 {
-	#guard
-	Spell(guard)
-	#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)
+	#blackout_kick,if=buff.shuffle.down
+	if BuffExpires(shuffle_buff) Spell(blackout_kick)
+	#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)
-	#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)
-	#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)
-	#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)
-	#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)
-}
-
-AddFunction BrewmasterPrecombatActions
+	#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
+{
+	#purifying_brew,if=stagger.heavy
+	if DebuffPresent(heavy_stagger_debuff) Spell(purifying_brew)
+
+	unless BuffExpires(shuffle_buff) and Spell(blackout_kick)
+	{
+		#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)
+		{
+			#chi_burst,if=(energy+(energy.regen*gcd))<100
+			if Energy() + EnergyRegenRate() * GCD() < 100 and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
+		}
+	}
+}
+
+### actions.precombat
+
+AddFunction BrewmasterPrecombatMainActions
 {
 	#flask,type=greater_draenic_stamina_flask
-	#food,type=sleeper_surprise
+	#food,type=talador_surf_and_turf
 	#stance,choose=sturdy_ox
 	Spell(stance_of_the_sturdy_ox)
-	#snapshot_stats
-	#potion,name=draenic_agility
-	UsePotionAgility()
-	#dampen_harm
-	Spell(dampen_harm)
 }

-AddFunction BrewmasterStActions
+AddFunction BrewmasterPrecombatCdActions
+{
+	unless Spell(stance_of_the_sturdy_ox)
+	{
+		#snapshot_stats
+		#potion,name=draenic_armor
+		UsePotionArmor()
+		#dampen_harm
+		Spell(dampen_harm)
+	}
+}
+
+### actions.st
+
+AddFunction BrewmasterStMainActions
 {
 	#blackout_kick,if=buff.shuffle.down
 	if BuffExpires(shuffle_buff) 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)
-	#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)
-	#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)
-	#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=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 MaxChi() - Chi() >= 1 and not BuffPresent(serenity_buff) and Spell(keg_smash)
+		{
+			#chi_burst,if=(energy+(energy.regen*gcd))<100
+			if Energy() + EnergyRegenRate() * GCD() < 100 and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
+		}
+	}
+}
+
+### Brewmaster icons.
+AddCheckBox(opt_monk_brewmaster_aoe L(AOE) specialization=brewmaster default)
+
+AddIcon specialization=brewmaster help=shortcd enemies=1 checkbox=!opt_monk_brewmaster_aoe
+{
+	BrewmasterDefaultShortCdActions()
+}
+
+AddIcon specialization=brewmaster help=shortcd checkbox=opt_monk_brewmaster_aoe
+{
+	BrewmasterDefaultShortCdActions()
 }

 AddIcon specialization=brewmaster help=main enemies=1
 {
-	if not InCombat() BrewmasterPrecombatActions()
-	BrewmasterDefaultActions()
+	if not InCombat() BrewmasterPrecombatMainActions()
+	BrewmasterDefaultMainActions()
+}
+
+AddIcon specialization=brewmaster help=aoe checkbox=opt_monk_brewmaster_aoe
+{
+	if not InCombat() BrewmasterPrecombatMainActions()
+	BrewmasterDefaultMainActions()
+}
+
+AddIcon specialization=brewmaster help=cd enemies=1 checkbox=!opt_monk_brewmaster_aoe
+{
+	if not InCombat() BrewmasterPrecombatCdActions()
+	BrewmasterDefaultCdActions()
 }

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

 ### Required symbols
@@ -182,16 +263,14 @@ AddIcon specialization=brewmaster help=aoe
 # chi_brew
 # chi_brew_talent
 # chi_burst
-# chi_burst_talent
 # chi_explosion_talent
 # chi_explosion_tank
 # chi_wave
-# chi_wave_talent
 # dampen_harm
 # dampen_harm_buff
 # diffuse_magic
 # diffuse_magic_buff
-# draenic_agility_potion
+# draenic_armor_potion
 # elusive_brew
 # elusive_brew_activated_buff
 # elusive_brew_stacks_buff
@@ -215,7 +294,6 @@ AddIcon specialization=brewmaster help=aoe
 # serenity_talent
 # shuffle_buff
 # spear_hand_strike
-# spinning_crane_kick
 # stance_of_the_sturdy_ox
 # tiger_palm
 # war_stomp
diff --git a/scripts/simulationcraft_monk_brewmaster_1h_serenity.lua b/scripts/simulationcraft_monk_brewmaster_1h_serenity.lua
index 6df6328..f9e09cb 100644
--- a/scripts/simulationcraft_monk_brewmaster_1h_serenity.lua
+++ b/scripts/simulationcraft_monk_brewmaster_1h_serenity.lua
@@ -8,18 +8,18 @@ do
 # Based on SimulationCraft profile "Monk_Brewmaster_1h_Serenity_T17M".
 #	class=monk
 #	spec=brewmaster
-#	talents=0130223
+#	talents=2133123
 #	glyphs=fortifying_brew,expel_harm,fortuitous_spheres

 Include(ovale_common)
 Include(ovale_monk_spells)

-AddCheckBox(opt_potion_agility ItemName(draenic_agility_potion) default)
+AddCheckBox(opt_potion_armor ItemName(draenic_armor_potion) default)
 AddCheckBox(opt_chi_burst SpellName(chi_burst) default)

-AddFunction UsePotionAgility
+AddFunction UsePotionArmor
 {
-	if CheckBoxOn(opt_potion_agility) and target.Classification(worldboss) Item(draenic_agility_potion usable=1)
+	if CheckBoxOn(opt_potion_armor) and target.Classification(worldboss) Item(draenic_armor_potion usable=1)
 }

 AddFunction InterruptActions
@@ -37,7 +37,34 @@ AddFunction InterruptActions
 	}
 }

-AddFunction BrewmasterDefaultActions
+### actions.default
+
+AddFunction BrewmasterDefaultMainActions
+{
+	#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 BrewmasterStMainActions()
+	#call_action_list,name=aoe,if=active_enemies>=3
+	if Enemies() >= 3 BrewmasterAoeMainActions()
+}
+
+AddFunction BrewmasterDefaultShortCdActions
+{
+	#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&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
+	if Enemies() >= 3 BrewmasterAoeShortCdActions()
+}
+
+AddFunction BrewmasterDefaultCdActions
 {
 	#auto_attack
 	#blood_fury,if=energy<=40
@@ -46,8 +73,6 @@ AddFunction BrewmasterDefaultActions
 	if Energy() <= 40 Spell(berserking)
 	#arcane_torrent,if=energy<=40
 	if Energy() <= 40 Spell(arcane_torrent_chi)
-	#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
 	#diffuse_magic,if=incoming_damage_1500ms&buff.fortifying_brew.down
 	if IncomingDamage(1.5) > 0 and BuffExpires(fortifying_brew_buff) Spell(diffuse_magic)
@@ -55,121 +80,177 @@ AddFunction BrewmasterDefaultActions
 	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)
-	#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)
-	#invoke_xuen,if=talent.invoke_xuen.enabled&time>5
-	if Talent(invoke_xuen_talent) and TimeInCombat() > 5 Spell(invoke_xuen)
-	#serenity,if=talent.serenity.enabled&energy<=40
-	if Talent(serenity_talent) and Energy() <= 40 Spell(serenity)
-	#call_action_list,name=st,if=active_enemies<3
-	if Enemies() < 3 BrewmasterStActions()
-	#call_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 BrewmasterAoeActions()
+	#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()
 }

-AddFunction BrewmasterAoeActions
+### actions.aoe
+
+AddFunction BrewmasterAoeMainActions
 {
-	#guard
-	Spell(guard)
-	#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)
+	#blackout_kick,if=buff.shuffle.down
+	if BuffExpires(shuffle_buff) Spell(blackout_kick)
+	#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)
-	#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)
-	#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)
-	#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)
-	#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)
-}
-
-AddFunction BrewmasterPrecombatActions
+	#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
+{
+	#purifying_brew,if=stagger.heavy
+	if DebuffPresent(heavy_stagger_debuff) Spell(purifying_brew)
+
+	unless BuffExpires(shuffle_buff) and Spell(blackout_kick)
+	{
+		#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)
+		{
+			#chi_burst,if=(energy+(energy.regen*gcd))<100
+			if Energy() + EnergyRegenRate() * GCD() < 100 and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
+		}
+	}
+}
+
+### actions.precombat
+
+AddFunction BrewmasterPrecombatMainActions
 {
 	#flask,type=greater_draenic_stamina_flask
-	#food,type=sleeper_surprise
+	#food,type=talador_surf_and_turf
 	#stance,choose=sturdy_ox
 	Spell(stance_of_the_sturdy_ox)
-	#snapshot_stats
-	#potion,name=draenic_agility
-	UsePotionAgility()
-	#dampen_harm
-	Spell(dampen_harm)
 }

-AddFunction BrewmasterStActions
+AddFunction BrewmasterPrecombatCdActions
+{
+	unless Spell(stance_of_the_sturdy_ox)
+	{
+		#snapshot_stats
+		#potion,name=draenic_armor
+		UsePotionArmor()
+		#dampen_harm
+		Spell(dampen_harm)
+	}
+}
+
+### actions.st
+
+AddFunction BrewmasterStMainActions
 {
 	#blackout_kick,if=buff.shuffle.down
 	if BuffExpires(shuffle_buff) 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)
-	#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)
-	#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)
-	#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=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 MaxChi() - Chi() >= 1 and not BuffPresent(serenity_buff) and Spell(keg_smash)
+		{
+			#chi_burst,if=(energy+(energy.regen*gcd))<100
+			if Energy() + EnergyRegenRate() * GCD() < 100 and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
+		}
+	}
+}
+
+### Brewmaster icons.
+AddCheckBox(opt_monk_brewmaster_aoe L(AOE) specialization=brewmaster default)
+
+AddIcon specialization=brewmaster help=shortcd enemies=1 checkbox=!opt_monk_brewmaster_aoe
+{
+	BrewmasterDefaultShortCdActions()
+}
+
+AddIcon specialization=brewmaster help=shortcd checkbox=opt_monk_brewmaster_aoe
+{
+	BrewmasterDefaultShortCdActions()
 }

 AddIcon specialization=brewmaster help=main enemies=1
 {
-	if not InCombat() BrewmasterPrecombatActions()
-	BrewmasterDefaultActions()
+	if not InCombat() BrewmasterPrecombatMainActions()
+	BrewmasterDefaultMainActions()
+}
+
+AddIcon specialization=brewmaster help=aoe checkbox=opt_monk_brewmaster_aoe
+{
+	if not InCombat() BrewmasterPrecombatMainActions()
+	BrewmasterDefaultMainActions()
+}
+
+AddIcon specialization=brewmaster help=cd enemies=1 checkbox=!opt_monk_brewmaster_aoe
+{
+	if not InCombat() BrewmasterPrecombatCdActions()
+	BrewmasterDefaultCdActions()
 }

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

 ### Required symbols
@@ -182,16 +263,14 @@ AddIcon specialization=brewmaster help=aoe
 # chi_brew
 # chi_brew_talent
 # chi_burst
-# chi_burst_talent
 # chi_explosion_talent
 # chi_explosion_tank
 # chi_wave
-# chi_wave_talent
 # dampen_harm
 # dampen_harm_buff
 # diffuse_magic
 # diffuse_magic_buff
-# draenic_agility_potion
+# draenic_armor_potion
 # elusive_brew
 # elusive_brew_activated_buff
 # elusive_brew_stacks_buff
@@ -215,7 +294,6 @@ AddIcon specialization=brewmaster help=aoe
 # serenity_talent
 # shuffle_buff
 # spear_hand_strike
-# spinning_crane_kick
 # stance_of_the_sturdy_ox
 # tiger_palm
 # war_stomp
diff --git a/scripts/simulationcraft_monk_brewmaster_2h_ce.lua b/scripts/simulationcraft_monk_brewmaster_2h_ce.lua
index 509b13f..6b5d67d 100644
--- a/scripts/simulationcraft_monk_brewmaster_2h_ce.lua
+++ b/scripts/simulationcraft_monk_brewmaster_2h_ce.lua
@@ -8,18 +8,18 @@ do
 # Based on SimulationCraft profile "Monk_Brewmaster_2h_CE_T17M".
 #	class=monk
 #	spec=brewmaster
-#	talents=0120222
+#	talents=2133112
 #	glyphs=fortifying_brew,expel_harm,fortuitous_spheres

 Include(ovale_common)
 Include(ovale_monk_spells)

-AddCheckBox(opt_potion_agility ItemName(draenic_agility_potion) default)
+AddCheckBox(opt_potion_armor ItemName(draenic_armor_potion) default)
 AddCheckBox(opt_chi_burst SpellName(chi_burst) default)

-AddFunction UsePotionAgility
+AddFunction UsePotionArmor
 {
-	if CheckBoxOn(opt_potion_agility) and target.Classification(worldboss) Item(draenic_agility_potion usable=1)
+	if CheckBoxOn(opt_potion_armor) and target.Classification(worldboss) Item(draenic_armor_potion usable=1)
 }

 AddFunction InterruptActions
@@ -37,7 +37,34 @@ AddFunction InterruptActions
 	}
 }

-AddFunction BrewmasterDefaultActions
+### actions.default
+
+AddFunction BrewmasterDefaultMainActions
+{
+	#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 BrewmasterStMainActions()
+	#call_action_list,name=aoe,if=active_enemies>=3
+	if Enemies() >= 3 BrewmasterAoeMainActions()
+}
+
+AddFunction BrewmasterDefaultShortCdActions
+{
+	#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&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
+	if Enemies() >= 3 BrewmasterAoeShortCdActions()
+}
+
+AddFunction BrewmasterDefaultCdActions
 {
 	#auto_attack
 	#blood_fury,if=energy<=40
@@ -46,8 +73,6 @@ AddFunction BrewmasterDefaultActions
 	if Energy() <= 40 Spell(berserking)
 	#arcane_torrent,if=energy<=40
 	if Energy() <= 40 Spell(arcane_torrent_chi)
-	#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
 	#diffuse_magic,if=incoming_damage_1500ms&buff.fortifying_brew.down
 	if IncomingDamage(1.5) > 0 and BuffExpires(fortifying_brew_buff) Spell(diffuse_magic)
@@ -55,121 +80,177 @@ AddFunction BrewmasterDefaultActions
 	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)
-	#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)
-	#invoke_xuen,if=talent.invoke_xuen.enabled&time>5
-	if Talent(invoke_xuen_talent) and TimeInCombat() > 5 Spell(invoke_xuen)
-	#serenity,if=talent.serenity.enabled&energy<=40
-	if Talent(serenity_talent) and Energy() <= 40 Spell(serenity)
-	#call_action_list,name=st,if=active_enemies<3
-	if Enemies() < 3 BrewmasterStActions()
-	#call_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 BrewmasterAoeActions()
+	#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()
 }

-AddFunction BrewmasterAoeActions
+### actions.aoe
+
+AddFunction BrewmasterAoeMainActions
 {
-	#guard
-	Spell(guard)
-	#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)
+	#blackout_kick,if=buff.shuffle.down
+	if BuffExpires(shuffle_buff) Spell(blackout_kick)
+	#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)
-	#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)
-	#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)
-	#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)
-	#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)
-}
-
-AddFunction BrewmasterPrecombatActions
+	#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
+{
+	#purifying_brew,if=stagger.heavy
+	if DebuffPresent(heavy_stagger_debuff) Spell(purifying_brew)
+
+	unless BuffExpires(shuffle_buff) and Spell(blackout_kick)
+	{
+		#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)
+		{
+			#chi_burst,if=(energy+(energy.regen*gcd))<100
+			if Energy() + EnergyRegenRate() * GCD() < 100 and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
+		}
+	}
+}
+
+### actions.precombat
+
+AddFunction BrewmasterPrecombatMainActions
 {
 	#flask,type=greater_draenic_stamina_flask
-	#food,type=sleeper_surprise
+	#food,type=talador_surf_and_turf
 	#stance,choose=sturdy_ox
 	Spell(stance_of_the_sturdy_ox)
-	#snapshot_stats
-	#potion,name=draenic_agility
-	UsePotionAgility()
-	#dampen_harm
-	Spell(dampen_harm)
 }

-AddFunction BrewmasterStActions
+AddFunction BrewmasterPrecombatCdActions
+{
+	unless Spell(stance_of_the_sturdy_ox)
+	{
+		#snapshot_stats
+		#potion,name=draenic_armor
+		UsePotionArmor()
+		#dampen_harm
+		Spell(dampen_harm)
+	}
+}
+
+### actions.st
+
+AddFunction BrewmasterStMainActions
 {
 	#blackout_kick,if=buff.shuffle.down
 	if BuffExpires(shuffle_buff) 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)
-	#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)
-	#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)
-	#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=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 MaxChi() - Chi() >= 1 and not BuffPresent(serenity_buff) and Spell(keg_smash)
+		{
+			#chi_burst,if=(energy+(energy.regen*gcd))<100
+			if Energy() + EnergyRegenRate() * GCD() < 100 and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
+		}
+	}
+}
+
+### Brewmaster icons.
+AddCheckBox(opt_monk_brewmaster_aoe L(AOE) specialization=brewmaster default)
+
+AddIcon specialization=brewmaster help=shortcd enemies=1 checkbox=!opt_monk_brewmaster_aoe
+{
+	BrewmasterDefaultShortCdActions()
+}
+
+AddIcon specialization=brewmaster help=shortcd checkbox=opt_monk_brewmaster_aoe
+{
+	BrewmasterDefaultShortCdActions()
 }

 AddIcon specialization=brewmaster help=main enemies=1
 {
-	if not InCombat() BrewmasterPrecombatActions()
-	BrewmasterDefaultActions()
+	if not InCombat() BrewmasterPrecombatMainActions()
+	BrewmasterDefaultMainActions()
+}
+
+AddIcon specialization=brewmaster help=aoe checkbox=opt_monk_brewmaster_aoe
+{
+	if not InCombat() BrewmasterPrecombatMainActions()
+	BrewmasterDefaultMainActions()
+}
+
+AddIcon specialization=brewmaster help=cd enemies=1 checkbox=!opt_monk_brewmaster_aoe
+{
+	if not InCombat() BrewmasterPrecombatCdActions()
+	BrewmasterDefaultCdActions()
 }

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

 ### Required symbols
@@ -182,16 +263,14 @@ AddIcon specialization=brewmaster help=aoe
 # chi_brew
 # chi_brew_talent
 # chi_burst
-# chi_burst_talent
 # chi_explosion_talent
 # chi_explosion_tank
 # chi_wave
-# chi_wave_talent
 # dampen_harm
 # dampen_harm_buff
 # diffuse_magic
 # diffuse_magic_buff
-# draenic_agility_potion
+# draenic_armor_potion
 # elusive_brew
 # elusive_brew_activated_buff
 # elusive_brew_stacks_buff
@@ -215,7 +294,6 @@ AddIcon specialization=brewmaster help=aoe
 # serenity_talent
 # shuffle_buff
 # spear_hand_strike
-# spinning_crane_kick
 # stance_of_the_sturdy_ox
 # tiger_palm
 # war_stomp
diff --git a/scripts/simulationcraft_monk_brewmaster_2h_serenity.lua b/scripts/simulationcraft_monk_brewmaster_2h_serenity.lua
index 3eb1092..843e5fa 100644
--- a/scripts/simulationcraft_monk_brewmaster_2h_serenity.lua
+++ b/scripts/simulationcraft_monk_brewmaster_2h_serenity.lua
@@ -8,18 +8,18 @@ do
 # Based on SimulationCraft profile "Monk_Brewmaster_2h_Serenity_T17M".
 #	class=monk
 #	spec=brewmaster
-#	talents=0130223
+#	talents=2133123
 #	glyphs=fortifying_brew,expel_harm,fortuitous_spheres

 Include(ovale_common)
 Include(ovale_monk_spells)

-AddCheckBox(opt_potion_agility ItemName(draenic_agility_potion) default)
+AddCheckBox(opt_potion_armor ItemName(draenic_armor_potion) default)
 AddCheckBox(opt_chi_burst SpellName(chi_burst) default)

-AddFunction UsePotionAgility
+AddFunction UsePotionArmor
 {
-	if CheckBoxOn(opt_potion_agility) and target.Classification(worldboss) Item(draenic_agility_potion usable=1)
+	if CheckBoxOn(opt_potion_armor) and target.Classification(worldboss) Item(draenic_armor_potion usable=1)
 }

 AddFunction InterruptActions
@@ -37,7 +37,34 @@ AddFunction InterruptActions
 	}
 }

-AddFunction BrewmasterDefaultActions
+### actions.default
+
+AddFunction BrewmasterDefaultMainActions
+{
+	#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 BrewmasterStMainActions()
+	#call_action_list,name=aoe,if=active_enemies>=3
+	if Enemies() >= 3 BrewmasterAoeMainActions()
+}
+
+AddFunction BrewmasterDefaultShortCdActions
+{
+	#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&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
+	if Enemies() >= 3 BrewmasterAoeShortCdActions()
+}
+
+AddFunction BrewmasterDefaultCdActions
 {
 	#auto_attack
 	#blood_fury,if=energy<=40
@@ -46,8 +73,6 @@ AddFunction BrewmasterDefaultActions
 	if Energy() <= 40 Spell(berserking)
 	#arcane_torrent,if=energy<=40
 	if Energy() <= 40 Spell(arcane_torrent_chi)
-	#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
 	#diffuse_magic,if=incoming_damage_1500ms&buff.fortifying_brew.down
 	if IncomingDamage(1.5) > 0 and BuffExpires(fortifying_brew_buff) Spell(diffuse_magic)
@@ -55,121 +80,177 @@ AddFunction BrewmasterDefaultActions
 	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)
-	#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)
-	#invoke_xuen,if=talent.invoke_xuen.enabled&time>5
-	if Talent(invoke_xuen_talent) and TimeInCombat() > 5 Spell(invoke_xuen)
-	#serenity,if=talent.serenity.enabled&energy<=40
-	if Talent(serenity_talent) and Energy() <= 40 Spell(serenity)
-	#call_action_list,name=st,if=active_enemies<3
-	if Enemies() < 3 BrewmasterStActions()
-	#call_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 BrewmasterAoeActions()
+	#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()
 }

-AddFunction BrewmasterAoeActions
+### actions.aoe
+
+AddFunction BrewmasterAoeMainActions
 {
-	#guard
-	Spell(guard)
-	#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)
+	#blackout_kick,if=buff.shuffle.down
+	if BuffExpires(shuffle_buff) Spell(blackout_kick)
+	#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)
-	#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)
-	#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)
-	#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)
-	#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)
-}
-
-AddFunction BrewmasterPrecombatActions
+	#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
+{
+	#purifying_brew,if=stagger.heavy
+	if DebuffPresent(heavy_stagger_debuff) Spell(purifying_brew)
+
+	unless BuffExpires(shuffle_buff) and Spell(blackout_kick)
+	{
+		#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)
+		{
+			#chi_burst,if=(energy+(energy.regen*gcd))<100
+			if Energy() + EnergyRegenRate() * GCD() < 100 and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
+		}
+	}
+}
+
+### actions.precombat
+
+AddFunction BrewmasterPrecombatMainActions
 {
 	#flask,type=greater_draenic_stamina_flask
-	#food,type=sleeper_surprise
+	#food,type=talador_surf_and_turf
 	#stance,choose=sturdy_ox
 	Spell(stance_of_the_sturdy_ox)
-	#snapshot_stats
-	#potion,name=draenic_agility
-	UsePotionAgility()
-	#dampen_harm
-	Spell(dampen_harm)
 }

-AddFunction BrewmasterStActions
+AddFunction BrewmasterPrecombatCdActions
+{
+	unless Spell(stance_of_the_sturdy_ox)
+	{
+		#snapshot_stats
+		#potion,name=draenic_armor
+		UsePotionArmor()
+		#dampen_harm
+		Spell(dampen_harm)
+	}
+}
+
+### actions.st
+
+AddFunction BrewmasterStMainActions
 {
 	#blackout_kick,if=buff.shuffle.down
 	if BuffExpires(shuffle_buff) 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)
-	#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)
-	#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)
-	#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=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 MaxChi() - Chi() >= 1 and not BuffPresent(serenity_buff) and Spell(keg_smash)
+		{
+			#chi_burst,if=(energy+(energy.regen*gcd))<100
+			if Energy() + EnergyRegenRate() * GCD() < 100 and CheckBoxOn(opt_chi_burst) Spell(chi_burst)
+		}
+	}
+}
+
+### Brewmaster icons.
+AddCheckBox(opt_monk_brewmaster_aoe L(AOE) specialization=brewmaster default)
+
+AddIcon specialization=brewmaster help=shortcd enemies=1 checkbox=!opt_monk_brewmaster_aoe
+{
+	BrewmasterDefaultShortCdActions()
+}
+
+AddIcon specialization=brewmaster help=shortcd checkbox=opt_monk_brewmaster_aoe
+{
+	BrewmasterDefaultShortCdActions()
 }

 AddIcon specialization=brewmaster help=main enemies=1
 {
-	if not InCombat() BrewmasterPrecombatActions()
-	BrewmasterDefaultActions()
+	if not InCombat() BrewmasterPrecombatMainActions()
+	BrewmasterDefaultMainActions()
+}
+
+AddIcon specialization=brewmaster help=aoe checkbox=opt_monk_brewmaster_aoe
+{
+	if not InCombat() BrewmasterPrecombatMainActions()
+	BrewmasterDefaultMainActions()
+}
+
+AddIcon specialization=brewmaster help=cd enemies=1 checkbox=!opt_monk_brewmaster_aoe
+{
+	if not InCombat() BrewmasterPrecombatCdActions()
+	BrewmasterDefaultCdActions()
 }

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

 ### Required symbols
@@ -182,16 +263,14 @@ AddIcon specialization=brewmaster help=aoe
 # chi_brew
 # chi_brew_talent
 # chi_burst
-# chi_burst_talent
 # chi_explosion_talent
 # chi_explosion_tank
 # chi_wave
-# chi_wave_talent
 # dampen_harm
 # dampen_harm_buff
 # diffuse_magic
 # diffuse_magic_buff
-# draenic_agility_potion
+# draenic_armor_potion
 # elusive_brew
 # elusive_brew_activated_buff
 # elusive_brew_stacks_buff
@@ -215,7 +294,6 @@ AddIcon specialization=brewmaster help=aoe
 # serenity_talent
 # shuffle_buff
 # spear_hand_strike
-# spinning_crane_kick
 # stance_of_the_sturdy_ox
 # tiger_palm
 # war_stomp
diff --git a/scripts/simulationcraft_monk_windwalker_1h.lua b/scripts/simulationcraft_monk_windwalker_1h.lua
index d7aec69..0794a0c 100644
--- a/scripts/simulationcraft_monk_windwalker_1h.lua
+++ b/scripts/simulationcraft_monk_windwalker_1h.lua
@@ -36,7 +36,52 @@ AddFunction InterruptActions
 	}
 }

-AddFunction WindwalkerDefaultActions
+### actions.default
+
+AddFunction WindwalkerDefaultMainActions
+{
+	#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
+	if BuffRemaining(tiger_power_buff) <= 3 Spell(tiger_palm)
+	#rising_sun_kick,if=(debuff.rising_sun_kick.down|debuff.rising_sun_kick.remains<3)
+	if target.DebuffExpires(rising_sun_kick_debuff) or target.DebuffRemaining(rising_sun_kick_debuff) < 3 Spell(rising_sun_kick)
+	#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 WindwalkerAoeMainActions()
+	#call_action_list,name=st,if=active_enemies<3
+	if Enemies() < 3 WindwalkerStMainActions()
+}
+
+AddFunction WindwalkerDefaultShortCdActions
+{
+	unless BuffRemaining(tiger_power_buff) <= 3 and Spell(tiger_palm)
+	{
+		#tigereye_brew,if=buff.tigereye_brew_use.down&buff.tigereye_brew.stack=20
+		if BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) == 20 Spell(tigereye_brew)
+		#tigereye_brew,if=buff.tigereye_brew_use.down&buff.tigereye_brew.stack>=10&buff.serenity.up
+		if BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) >= 10 and BuffPresent(serenity_buff) Spell(tigereye_brew)
+		#tigereye_brew,if=buff.tigereye_brew_use.down&buff.tigereye_brew.stack>=10&cooldown.fists_of_fury.up&chi>=3&debuff.rising_sun_kick.up&buff.tiger_power.up
+		if BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) >= 10 and not SpellCooldown(fists_of_fury) > 0 and Chi() >= 3 and target.DebuffPresent(rising_sun_kick_debuff) and BuffPresent(tiger_power_buff) Spell(tigereye_brew)
+		#tigereye_brew,if=talent.hurricane_strike.enabled&buff.tigereye_brew_use.down&buff.tigereye_brew.stack>=10&cooldown.hurricane_strike.up&chi>=3&debuff.rising_sun_kick.up&buff.tiger_power.up
+		if Talent(hurricane_strike_talent) and BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) >= 10 and not SpellCooldown(hurricane_strike) > 0 and Chi() >= 3 and target.DebuffPresent(rising_sun_kick_debuff) and BuffPresent(tiger_power_buff) Spell(tigereye_brew)
+		#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)
+		{
+			#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)
+			#call_action_list,name=aoe,if=active_enemies>=3
+			if Enemies() >= 3 WindwalkerAoeShortCdActions()
+			#call_action_list,name=st,if=active_enemies<3
+			if Enemies() < 3 WindwalkerStShortCdActions()
+		}
+	}
+}
+
+AddFunction WindwalkerDefaultCdActions
 {
 	#auto_attack
 	#invoke_xuen,if=talent.invoke_xuen.enabled&time>5
@@ -50,97 +95,112 @@ AddFunction WindwalkerDefaultActions
 	if BuffPresent(tigereye_brew_use_buff) or target.TimeToDie() < 18 Spell(berserking)
 	#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)
-	#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
-	if BuffRemaining(tiger_power_buff) <= 3 Spell(tiger_palm)
-	#tigereye_brew,if=buff.tigereye_brew_use.down&buff.tigereye_brew.stack=20
-	if BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) == 20 Spell(tigereye_brew)
-	#tigereye_brew,if=buff.tigereye_brew_use.down&buff.tigereye_brew.stack>=10&buff.serenity.up
-	if BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) >= 10 and BuffPresent(serenity_buff) Spell(tigereye_brew)
-	#tigereye_brew,if=buff.tigereye_brew_use.down&buff.tigereye_brew.stack>=10&cooldown.fists_of_fury.up&chi>=3&debuff.rising_sun_kick.up&buff.tiger_power.up
-	if BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) >= 10 and not SpellCooldown(fists_of_fury) > 0 and Chi() >= 3 and target.DebuffPresent(rising_sun_kick_debuff) and BuffPresent(tiger_power_buff) Spell(tigereye_brew)
-	#tigereye_brew,if=talent.hurricane_strike.enabled&buff.tigereye_brew_use.down&buff.tigereye_brew.stack>=10&cooldown.hurricane_strike.up&chi>=3&debuff.rising_sun_kick.up&buff.tiger_power.up
-	if Talent(hurricane_strike_talent) and BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) >= 10 and not SpellCooldown(hurricane_strike) > 0 and Chi() >= 3 and target.DebuffPresent(rising_sun_kick_debuff) and BuffPresent(tiger_power_buff) Spell(tigereye_brew)
-	#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)
-	#rising_sun_kick,if=(debuff.rising_sun_kick.down|debuff.rising_sun_kick.remains<3)
-	if target.DebuffExpires(rising_sun_kick_debuff) or target.DebuffRemaining(rising_sun_kick_debuff) < 3 Spell(rising_sun_kick)
-	#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)
-	#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)
-	#call_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 WindwalkerAoeActions()
-	#call_action_list,name=st,if=active_enemies<3
-	if Enemies() < 3 WindwalkerStActions()
+
+	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()
+		#call_action_list,name=st,if=active_enemies<3
+		if Enemies() < 3 WindwalkerStCdActions()
+	}
 }

-AddFunction WindwalkerAoeActions
+### actions.aoe
+
+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
 	if not Talent(rushing_jade_wind_talent) and Chi() == MaxChi() Spell(rising_sun_kick)
-	#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)
 	#zen_sphere,cycle_targets=1,if=!dot.zen_sphere.ticking
 	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 { SpellCooldown(fists_of_fury) > 3 or not Talent(rushing_jade_wind_talent) } and Spell(chi_explosion_melee) or Spell(rushing_jade_wind)
+	{
+		#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 WindwalkerPrecombatActions
+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)
+	}
+}
+
+### actions.precombat
+
+AddFunction WindwalkerPrecombatMainActions
 {
 	#flask,type=greater_draenic_agility_flask
 	#food,type=rylak_crepes
 	#stance,choose=fierce_tiger
 	Spell(stance_of_the_fierce_tiger)
-	#snapshot_stats
-	#potion,name=draenic_agility
-	UsePotionAgility()
 }

-AddFunction WindwalkerStActions
+AddFunction WindwalkerPrecombatCdActions
+{
+	unless Spell(stance_of_the_fierce_tiger)
+	{
+		#snapshot_stats
+		#potion,name=draenic_agility
+		UsePotionAgility()
+	}
+}
+
+### actions.st
+
+AddFunction WindwalkerStMainActions
 {
-	#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)
-	#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)
 	#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
@@ -149,18 +209,72 @@ 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=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
+{
+	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)
+	}
+}
+
+### Windwalker icons.
+AddCheckBox(opt_monk_windwalker_aoe L(AOE) specialization=windwalker default)
+
+AddIcon specialization=windwalker help=shortcd enemies=1 checkbox=!opt_monk_windwalker_aoe
+{
+	WindwalkerDefaultShortCdActions()
+}
+
+AddIcon specialization=windwalker help=shortcd checkbox=opt_monk_windwalker_aoe
+{
+	WindwalkerDefaultShortCdActions()
 }

 AddIcon specialization=windwalker help=main enemies=1
 {
-	if not InCombat() WindwalkerPrecombatActions()
-	WindwalkerDefaultActions()
+	if not InCombat() WindwalkerPrecombatMainActions()
+	WindwalkerDefaultMainActions()
+}
+
+AddIcon specialization=windwalker help=aoe checkbox=opt_monk_windwalker_aoe
+{
+	if not InCombat() WindwalkerPrecombatMainActions()
+	WindwalkerDefaultMainActions()
+}
+
+AddIcon specialization=windwalker help=cd enemies=1 checkbox=!opt_monk_windwalker_aoe
+{
+	if not InCombat() WindwalkerPrecombatCdActions()
+	WindwalkerDefaultCdActions()
 }

-AddIcon specialization=windwalker help=aoe
+AddIcon specialization=windwalker help=cd checkbox=opt_monk_windwalker_aoe
 {
-	if not InCombat() WindwalkerPrecombatActions()
-	WindwalkerDefaultActions()
+	if not InCombat() WindwalkerPrecombatCdActions()
+	WindwalkerDefaultCdActions()
 }

 ### Required symbols
@@ -182,6 +296,7 @@ AddIcon specialization=windwalker help=aoe
 # energizing_brew
 # energizing_brew_buff
 # fists_of_fury
+# fortifying_brew
 # hurricane_strike
 # hurricane_strike_talent
 # invoke_xuen
diff --git a/scripts/simulationcraft_monk_windwalker_2h.lua b/scripts/simulationcraft_monk_windwalker_2h.lua
index 54294ec..6c489af 100644
--- a/scripts/simulationcraft_monk_windwalker_2h.lua
+++ b/scripts/simulationcraft_monk_windwalker_2h.lua
@@ -36,7 +36,52 @@ AddFunction InterruptActions
 	}
 }

-AddFunction WindwalkerDefaultActions
+### actions.default
+
+AddFunction WindwalkerDefaultMainActions
+{
+	#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
+	if BuffRemaining(tiger_power_buff) <= 3 Spell(tiger_palm)
+	#rising_sun_kick,if=(debuff.rising_sun_kick.down|debuff.rising_sun_kick.remains<3)
+	if target.DebuffExpires(rising_sun_kick_debuff) or target.DebuffRemaining(rising_sun_kick_debuff) < 3 Spell(rising_sun_kick)
+	#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 WindwalkerAoeMainActions()
+	#call_action_list,name=st,if=active_enemies<3
+	if Enemies() < 3 WindwalkerStMainActions()
+}
+
+AddFunction WindwalkerDefaultShortCdActions
+{
+	unless BuffRemaining(tiger_power_buff) <= 3 and Spell(tiger_palm)
+	{
+		#tigereye_brew,if=buff.tigereye_brew_use.down&buff.tigereye_brew.stack=20
+		if BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) == 20 Spell(tigereye_brew)
+		#tigereye_brew,if=buff.tigereye_brew_use.down&buff.tigereye_brew.stack>=10&buff.serenity.up
+		if BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) >= 10 and BuffPresent(serenity_buff) Spell(tigereye_brew)
+		#tigereye_brew,if=buff.tigereye_brew_use.down&buff.tigereye_brew.stack>=10&cooldown.fists_of_fury.up&chi>=3&debuff.rising_sun_kick.up&buff.tiger_power.up
+		if BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) >= 10 and not SpellCooldown(fists_of_fury) > 0 and Chi() >= 3 and target.DebuffPresent(rising_sun_kick_debuff) and BuffPresent(tiger_power_buff) Spell(tigereye_brew)
+		#tigereye_brew,if=talent.hurricane_strike.enabled&buff.tigereye_brew_use.down&buff.tigereye_brew.stack>=10&cooldown.hurricane_strike.up&chi>=3&debuff.rising_sun_kick.up&buff.tiger_power.up
+		if Talent(hurricane_strike_talent) and BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) >= 10 and not SpellCooldown(hurricane_strike) > 0 and Chi() >= 3 and target.DebuffPresent(rising_sun_kick_debuff) and BuffPresent(tiger_power_buff) Spell(tigereye_brew)
+		#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)
+		{
+			#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)
+			#call_action_list,name=aoe,if=active_enemies>=3
+			if Enemies() >= 3 WindwalkerAoeShortCdActions()
+			#call_action_list,name=st,if=active_enemies<3
+			if Enemies() < 3 WindwalkerStShortCdActions()
+		}
+	}
+}
+
+AddFunction WindwalkerDefaultCdActions
 {
 	#auto_attack
 	#invoke_xuen,if=talent.invoke_xuen.enabled&time>5
@@ -50,97 +95,112 @@ AddFunction WindwalkerDefaultActions
 	if BuffPresent(tigereye_brew_use_buff) or target.TimeToDie() < 18 Spell(berserking)
 	#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)
-	#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
-	if BuffRemaining(tiger_power_buff) <= 3 Spell(tiger_palm)
-	#tigereye_brew,if=buff.tigereye_brew_use.down&buff.tigereye_brew.stack=20
-	if BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) == 20 Spell(tigereye_brew)
-	#tigereye_brew,if=buff.tigereye_brew_use.down&buff.tigereye_brew.stack>=10&buff.serenity.up
-	if BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) >= 10 and BuffPresent(serenity_buff) Spell(tigereye_brew)
-	#tigereye_brew,if=buff.tigereye_brew_use.down&buff.tigereye_brew.stack>=10&cooldown.fists_of_fury.up&chi>=3&debuff.rising_sun_kick.up&buff.tiger_power.up
-	if BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) >= 10 and not SpellCooldown(fists_of_fury) > 0 and Chi() >= 3 and target.DebuffPresent(rising_sun_kick_debuff) and BuffPresent(tiger_power_buff) Spell(tigereye_brew)
-	#tigereye_brew,if=talent.hurricane_strike.enabled&buff.tigereye_brew_use.down&buff.tigereye_brew.stack>=10&cooldown.hurricane_strike.up&chi>=3&debuff.rising_sun_kick.up&buff.tiger_power.up
-	if Talent(hurricane_strike_talent) and BuffExpires(tigereye_brew_use_buff) and BuffStacks(tigereye_brew_buff) >= 10 and not SpellCooldown(hurricane_strike) > 0 and Chi() >= 3 and target.DebuffPresent(rising_sun_kick_debuff) and BuffPresent(tiger_power_buff) Spell(tigereye_brew)
-	#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)
-	#rising_sun_kick,if=(debuff.rising_sun_kick.down|debuff.rising_sun_kick.remains<3)
-	if target.DebuffExpires(rising_sun_kick_debuff) or target.DebuffRemaining(rising_sun_kick_debuff) < 3 Spell(rising_sun_kick)
-	#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)
-	#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)
-	#call_action_list,name=aoe,if=active_enemies>=3
-	if Enemies() >= 3 WindwalkerAoeActions()
-	#call_action_list,name=st,if=active_enemies<3
-	if Enemies() < 3 WindwalkerStActions()
+
+	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()
+		#call_action_list,name=st,if=active_enemies<3
+		if Enemies() < 3 WindwalkerStCdActions()
+	}
 }

-AddFunction WindwalkerAoeActions
+### actions.aoe
+
+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
 	if not Talent(rushing_jade_wind_talent) and Chi() == MaxChi() Spell(rising_sun_kick)
-	#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)
 	#zen_sphere,cycle_targets=1,if=!dot.zen_sphere.ticking
 	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 { SpellCooldown(fists_of_fury) > 3 or not Talent(rushing_jade_wind_talent) } and Spell(chi_explosion_melee) or Spell(rushing_jade_wind)
+	{
+		#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 WindwalkerPrecombatActions
+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)
+	}
+}
+
+### actions.precombat
+
+AddFunction WindwalkerPrecombatMainActions
 {
 	#flask,type=greater_draenic_agility_flask
 	#food,type=rylak_crepes
 	#stance,choose=fierce_tiger
 	Spell(stance_of_the_fierce_tiger)
-	#snapshot_stats
-	#potion,name=draenic_agility
-	UsePotionAgility()
 }

-AddFunction WindwalkerStActions
+AddFunction WindwalkerPrecombatCdActions
+{
+	unless Spell(stance_of_the_fierce_tiger)
+	{
+		#snapshot_stats
+		#potion,name=draenic_agility
+		UsePotionAgility()
+	}
+}
+
+### actions.st
+
+AddFunction WindwalkerStMainActions
 {
-	#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)
-	#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)
 	#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
@@ -149,18 +209,72 @@ 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=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
+{
+	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)
+	}
+}
+
+### Windwalker icons.
+AddCheckBox(opt_monk_windwalker_aoe L(AOE) specialization=windwalker default)
+
+AddIcon specialization=windwalker help=shortcd enemies=1 checkbox=!opt_monk_windwalker_aoe
+{
+	WindwalkerDefaultShortCdActions()
+}
+
+AddIcon specialization=windwalker help=shortcd checkbox=opt_monk_windwalker_aoe
+{
+	WindwalkerDefaultShortCdActions()
 }

 AddIcon specialization=windwalker help=main enemies=1
 {
-	if not InCombat() WindwalkerPrecombatActions()
-	WindwalkerDefaultActions()
+	if not InCombat() WindwalkerPrecombatMainActions()
+	WindwalkerDefaultMainActions()
+}
+
+AddIcon specialization=windwalker help=aoe checkbox=opt_monk_windwalker_aoe
+{
+	if not InCombat() WindwalkerPrecombatMainActions()
+	WindwalkerDefaultMainActions()
+}
+
+AddIcon specialization=windwalker help=cd enemies=1 checkbox=!opt_monk_windwalker_aoe
+{
+	if not InCombat() WindwalkerPrecombatCdActions()
+	WindwalkerDefaultCdActions()
 }

-AddIcon specialization=windwalker help=aoe
+AddIcon specialization=windwalker help=cd checkbox=opt_monk_windwalker_aoe
 {
-	if not InCombat() WindwalkerPrecombatActions()
-	WindwalkerDefaultActions()
+	if not InCombat() WindwalkerPrecombatCdActions()
+	WindwalkerDefaultCdActions()
 }

 ### Required symbols
@@ -182,6 +296,7 @@ AddIcon specialization=windwalker help=aoe
 # energizing_brew
 # energizing_brew_buff
 # fists_of_fury
+# fortifying_brew
 # hurricane_strike
 # hurricane_strike_talent
 # invoke_xuen
diff --git a/scripts/simulationcraft_paladin_holy.lua b/scripts/simulationcraft_paladin_holy.lua
index 224742c..f4eea26 100644
--- a/scripts/simulationcraft_paladin_holy.lua
+++ b/scripts/simulationcraft_paladin_holy.lua
@@ -27,13 +27,39 @@ AddFunction RighteousFuryOff
 	if CheckBoxOn(opt_righteous_fury_check) and BuffPresent(righteous_fury) Texture(spell_holy_sealoffury text=cancel)
 }

-AddFunction HolyDefaultActions
+### actions.default
+
+AddFunction HolyDefaultMainActions
+{
+	#judgment,if=talent.selfless_healer.enabled&buff.selfless_healer.stack<3
+	if Talent(selfless_healer_talent) and BuffStacks(selfless_healer_buff) < 3 Spell(judgment)
+	#word_of_glory,if=holy_power>=3
+	if HolyPower() >= 3 Spell(word_of_glory)
+	#wait,if=target.health.pct>=75&mana.pct<=10
+	unless target.HealthPercent() >= 75 and ManaPercent() <= 10
+	{
+		#holy_shock,if=holy_power<=3
+		if HolyPower() <= 3 Spell(holy_shock)
+		#flash_of_light,if=target.health.pct<=30
+		if target.HealthPercent() <= 30 Spell(flash_of_light)
+		#judgment,if=holy_power<3
+		if HolyPower() < 3 Spell(judgment)
+		#holy_light
+		Spell(holy_light)
+	}
+}
+
+AddFunction HolyDefaultShortCdActions
 {
-	#mana_potion,if=mana.pct<=75
-	if ManaPercent() <= 75 UsePotionMana()
 	#auto_attack
 	#speed_of_light,if=movement.remains>1
 	if 0 > 1 Spell(speed_of_light)
+}
+
+AddFunction HolyDefaultCdActions
+{
+	#mana_potion,if=mana.pct<=75
+	if ManaPercent() <= 75 UsePotionMana()
 	#blood_fury
 	Spell(blood_fury_apsp)
 	#berserking
@@ -44,24 +70,24 @@ AddFunction HolyDefaultActions
 	Spell(avenging_wrath_heal)
 	#lay_on_hands,if=incoming_damage_5s>health.max*0.7
 	if IncomingDamage(5) > MaxHealth() * 0.7 Spell(lay_on_hands)
-	#judgment,if=talent.selfless_healer.enabled&buff.selfless_healer.stack<3
-	if Talent(selfless_healer_talent) and BuffStacks(selfless_healer_buff) < 3 Spell(judgment)
-	#word_of_glory,if=holy_power>=3
-	if HolyPower() >= 3 Spell(word_of_glory)
-	#wait,if=target.health.pct>=75&mana.pct<=10
-	#holy_shock,if=holy_power<=3
-	if HolyPower() <= 3 Spell(holy_shock)
-	#flash_of_light,if=target.health.pct<=30
-	if target.HealthPercent() <= 30 Spell(flash_of_light)
-	#judgment,if=holy_power<3
-	if HolyPower() < 3 Spell(judgment)
-	#lay_on_hands,if=mana.pct<5
-	if ManaPercent() < 5 Spell(lay_on_hands)
-	#holy_light
-	Spell(holy_light)
+
+	unless Talent(selfless_healer_talent) and BuffStacks(selfless_healer_buff) < 3 and Spell(judgment) or HolyPower() >= 3 and Spell(word_of_glory)
+	{
+		#wait,if=target.health.pct>=75&mana.pct<=10
+		unless target.HealthPercent() >= 75 and ManaPercent() <= 10
+		{
+			unless HolyPower() <= 3 and Spell(holy_shock) or target.HealthPercent() <= 30 and Spell(flash_of_light) or HolyPower() < 3 and Spell(judgment)
+			{
+				#lay_on_hands,if=mana.pct<5
+				if ManaPercent() < 5 Spell(lay_on_hands)
+			}
+		}
+	}
 }

-AddFunction HolyPrecombatActions
+### actions.precombat
+
+AddFunction HolyPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=blackrock_barbecue
@@ -73,19 +99,41 @@ AddFunction HolyPrecombatActions
 	Spell(seal_of_insight)
 	#beacon_of_light,target=healing_target
 	Spell(beacon_of_light text=healing_target)
-	#snapshot_stats
+}
+
+### Holy icons.
+AddCheckBox(opt_paladin_holy_aoe L(AOE) specialization=holy default)
+
+AddIcon specialization=holy help=shortcd enemies=1 checkbox=!opt_paladin_holy_aoe
+{
+	HolyDefaultShortCdActions()
+}
+
+AddIcon specialization=holy help=shortcd checkbox=opt_paladin_holy_aoe
+{
+	HolyDefaultShortCdActions()
 }

 AddIcon specialization=holy help=main enemies=1
 {
-	if not InCombat() HolyPrecombatActions()
-	HolyDefaultActions()
+	if not InCombat() HolyPrecombatMainActions()
+	HolyDefaultMainActions()
+}
+
+AddIcon specialization=holy help=aoe checkbox=opt_paladin_holy_aoe
+{
+	if not InCombat() HolyPrecombatMainActions()
+	HolyDefaultMainActions()
+}
+
+AddIcon specialization=holy help=cd enemies=1 checkbox=!opt_paladin_holy_aoe
+{
+	HolyDefaultCdActions()
 }

-AddIcon specialization=holy help=aoe
+AddIcon specialization=holy help=cd checkbox=opt_paladin_holy_aoe
 {
-	if not InCombat() HolyPrecombatActions()
-	HolyDefaultActions()
+	HolyDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_paladin_protection.lua b/scripts/simulationcraft_paladin_protection.lua
index b0b3b0e..383d025 100644
--- a/scripts/simulationcraft_paladin_protection.lua
+++ b/scripts/simulationcraft_paladin_protection.lua
@@ -38,45 +38,14 @@ AddFunction ProtectionTimeToHPG
 	if not Talent(sanctified_wrath_talent) SpellCooldown(crusader_strike judgment)
 }

-AddFunction ProtectionDefaultActions
+### actions.default
+
+AddFunction ProtectionDefaultMainActions
 {
-	#auto_attack
-	#speed_of_light,if=movement.remains>1
-	if 0 > 1 Spell(speed_of_light)
-	#blood_fury
-	Spell(blood_fury_apsp)
-	#berserking
-	Spell(berserking)
-	#arcane_torrent
-	Spell(arcane_torrent_holy)
 	#run_action_list,name=max_dps,if=role.attack|0
-	if False(role_attack) or 0 ProtectionMaxDpsActions()
+	if False(role_attack) or 0 ProtectionMaxDpsMainActions()
 	#run_action_list,name=max_survival,if=0
-	if 0 ProtectionMaxSurvivalActions()
-	#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)
-	#seraphim
-	Spell(seraphim)
-	#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)
-	#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)
-	#harsh_word,if=glyph.harsh_words.enabled&holy_power>=3
-	if Glyph(glyph_of_harsh_words) and HolyPower() >= 3 Spell(harsh_word)
-	#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)
+	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
@@ -111,20 +80,12 @@ AddFunction ProtectionDefaultActions
 			if Glyph(glyph_of_final_wrath) and target.HealthPercent() <= 20 Spell(holy_wrath)
 			#avengers_shield
 			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)
 			#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)
-			#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)
 			#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)
-			#consecration,if=target.debuff.flying.down
-			if target.True(debuff_flying_down) Spell(consecration)
 			#holy_wrath
 			Spell(holy_wrath)
 			#seal_of_insight,if=talent.empowered_seals.enabled&!seal.insight&buff.uthers_insight.remains<=buff.liadrins_righteousness.remains&buff.uthers_insight.remains<=buff.maraads_truth.remains
@@ -141,20 +102,93 @@ AddFunction ProtectionDefaultActions
 	}
 }

-AddFunction ProtectionMaxDpsActions
+AddFunction ProtectionDefaultShortCdActions
 {
-	#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)
+	#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)
+	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)
+	#harsh_word,if=glyph.harsh_words.enabled&holy_power>=3
+	if Glyph(glyph_of_harsh_words) and HolyPower() >= 3 Spell(harsh_word)
 	#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=(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 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 Glyph(glyph_of_double_jeopardy) and True(last_judgement_target) 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) 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)
+						{
+							#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)
+							{
+								#consecration,if=target.debuff.flying.down
+								if target.True(debuff_flying_down) Spell(consecration)
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+AddFunction ProtectionDefaultCdActions
+{
+	#blood_fury
+	Spell(blood_fury_apsp)
+	#berserking
+	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)
+}
+
+### 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))
@@ -181,8 +215,6 @@ AddFunction ProtectionMaxDpsActions
 			if Talent(sanctified_wrath_talent) Spell(holy_wrath)
 			#avengers_shield,if=buff.grand_crusader.react
 			if BuffPresent(grand_crusader_buff) Spell(avengers_shield)
-			#execution_sentence,if=active_enemies<3
-			if Enemies() < 3 Spell(execution_sentence)
 			#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
@@ -191,18 +223,10 @@ AddFunction ProtectionMaxDpsActions
 			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)
-			#lights_hammer
-			Spell(lights_hammer)
 			#holy_prism
 			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)
 			#hammer_of_wrath
 			Spell(hammer_of_wrath)
-			#consecration,if=target.debuff.flying.down
-			if target.True(debuff_flying_down) Spell(consecration)
 			#holy_wrath
 			Spell(holy_wrath)
 			#seal_of_truth,if=talent.empowered_seals.enabled&!seal.truth&buff.maraads_truth.remains<buff.liadrins_righteousness.remains
@@ -217,30 +241,70 @@ AddFunction ProtectionMaxDpsActions
 	}
 }

-AddFunction ProtectionMaxSurvivalActions
+AddFunction ProtectionMaxDpsShortCdActions
 {
-	#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)
-	#seraphim,if=buff.divine_protection.down&cooldown.divine_protection.remains>0
-	if BuffExpires(divine_protection_buff) and SpellCooldown(divine_protection) > 0 Spell(seraphim)
-	#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)
-	#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)
+	#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|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=(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
+		{
+			unless Glyph(glyph_of_double_jeopardy) and True(last_judgement_target) 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 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
@@ -265,14 +329,8 @@ AddFunction ProtectionMaxSurvivalActions
 			if BuffPresent(sacred_shield_buff) < 2 Spell(sacred_shield)
 			#avengers_shield
 			Spell(avengers_shield)
-			#lights_hammer
-			Spell(lights_hammer)
 			#holy_prism
 			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)
 			#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
@@ -281,8 +339,6 @@ AddFunction ProtectionMaxSurvivalActions
 			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)
-			#consecration,if=target.debuff.flying.down&!ticking
-			if target.True(debuff_flying_down) and not target.DebuffPresent(consecration_debuff) Spell(consecration)
 			#holy_wrath
 			Spell(holy_wrath)
 			#sacred_shield
@@ -291,7 +347,73 @@ AddFunction ProtectionMaxSurvivalActions
 	}
 }

-AddFunction ProtectionPrecombatActions
+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
+		{
+			unless Glyph(glyph_of_double_jeopardy) and True(last_judgement_target) 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
@@ -303,21 +425,53 @@ AddFunction ProtectionPrecombatActions
 	Spell(seal_of_insight)
 	#sacred_shield
 	Spell(sacred_shield)
-	#snapshot_stats
-	#potion,name=draenic_armor
-	UsePotionArmor()
+}
+
+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)
+	{
+		#snapshot_stats
+		#potion,name=draenic_armor
+		UsePotionArmor()
+	}
+}
+
+### Protection icons.
+AddCheckBox(opt_paladin_protection_aoe L(AOE) specialization=protection default)
+
+AddIcon specialization=protection help=shortcd enemies=1 checkbox=!opt_paladin_protection_aoe
+{
+	ProtectionDefaultShortCdActions()
+}
+
+AddIcon specialization=protection help=shortcd checkbox=opt_paladin_protection_aoe
+{
+	ProtectionDefaultShortCdActions()
 }

 AddIcon specialization=protection help=main enemies=1
 {
-	if not InCombat() ProtectionPrecombatActions()
-	ProtectionDefaultActions()
+	if not InCombat() ProtectionPrecombatMainActions()
+	ProtectionDefaultMainActions()
+}
+
+AddIcon specialization=protection help=aoe checkbox=opt_paladin_protection_aoe
+{
+	if not InCombat() ProtectionPrecombatMainActions()
+	ProtectionDefaultMainActions()
+}
+
+AddIcon specialization=protection help=cd enemies=1 checkbox=!opt_paladin_protection_aoe
+{
+	if not InCombat() ProtectionPrecombatCdActions()
+	ProtectionDefaultCdActions()
 }

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

 ### Required symbols
diff --git a/scripts/simulationcraft_paladin_retribution.lua b/scripts/simulationcraft_paladin_retribution.lua
index f2ddeec..1a37f02 100644
--- a/scripts/simulationcraft_paladin_retribution.lua
+++ b/scripts/simulationcraft_paladin_retribution.lua
@@ -56,52 +56,72 @@ AddFunction RighteousFuryOff
 	if CheckBoxOn(opt_righteous_fury_check) and BuffPresent(righteous_fury) Texture(spell_holy_sealoffury text=cancel)
 }

-AddFunction RetributionDefaultActions
+### actions.default
+
+AddFunction RetributionDefaultMainActions
 {
-	#rebuke
-	InterruptActions()
-	#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()
-	#auto_attack
-	#speed_of_light,if=movement.distance>5
-	if 0 > 5 Spell(speed_of_light)
 	#judgment,if=talent.empowered_seals.enabled&time<2
 	if Talent(empowered_seals_talent) and TimeInCombat() < 2 Spell(judgment)
-	#execution_sentence
-	Spell(execution_sentence)
-	#lights_hammer
-	Spell(lights_hammer)
-	#use_item,name=vial_of_convulsive_shadows,if=buff.avenging_wrath.up
-	if BuffPresent(avenging_wrath_melee_buff) UseItemActions()
-	#holy_avenger,sync=seraphim,if=talent.seraphim.enabled
-	if not SpellCooldown(seraphim) > 0 and Talent(seraphim_talent) Spell(holy_avenger)
-	#holy_avenger,if=holy_power<=2&!talent.seraphim.enabled
-	if HolyPower() <= 2 and not Talent(seraphim_talent) Spell(holy_avenger)
-	#avenging_wrath,sync=seraphim,if=talent.seraphim.enabled
-	if not SpellCooldown(seraphim) > 0 and Talent(seraphim_talent) Spell(avenging_wrath_melee)
-	#avenging_wrath,if=!talent.seraphim.enabled
-	if not Talent(seraphim_talent) Spell(avenging_wrath_melee)
-	#blood_fury
-	Spell(blood_fury_apsp)
-	#berserking
-	Spell(berserking)
-	#arcane_torrent
-	Spell(arcane_torrent_holy)
-	#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()
 	}
 }

-AddFunction RetributionAoeActions
+AddFunction RetributionDefaultShortCdActions
+{
+	#auto_attack
+	#speed_of_light,if=movement.distance>5
+	if 0 > 5 Spell(speed_of_light)
+
+	unless Talent(empowered_seals_talent) and TimeInCombat() < 2 and Spell(judgment)
+	{
+		#execution_sentence
+		Spell(execution_sentence)
+		#lights_hammer
+		Spell(lights_hammer)
+		#seraphim
+		Spell(seraphim)
+	}
+}
+
+AddFunction RetributionDefaultCdActions
+{
+	#rebuke
+	InterruptActions()
+	#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)
+	{
+		#use_item,name=vial_of_convulsive_shadows,if=buff.avenging_wrath.up
+		if BuffPresent(avenging_wrath_melee_buff) UseItemActions()
+		#holy_avenger,sync=seraphim,if=talent.seraphim.enabled
+		if not SpellCooldown(seraphim) > 0 and Talent(seraphim_talent) Spell(holy_avenger)
+		#holy_avenger,if=holy_power<=2&!talent.seraphim.enabled
+		if HolyPower() <= 2 and not Talent(seraphim_talent) Spell(holy_avenger)
+		#avenging_wrath,sync=seraphim,if=talent.seraphim.enabled
+		if not SpellCooldown(seraphim) > 0 and Talent(seraphim_talent) Spell(avenging_wrath_melee)
+		#avenging_wrath,if=!talent.seraphim.enabled
+		if not Talent(seraphim_talent) Spell(avenging_wrath_melee)
+		#blood_fury
+		Spell(blood_fury_apsp)
+		#berserking
+		Spell(berserking)
+		#arcane_torrent
+		Spell(arcane_torrent_holy)
+	}
+}
+
+### actions.aoe
+
+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)
@@ -127,7 +147,9 @@ AddFunction RetributionAoeActions
 	Spell(exorcism)
 }

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

-AddFunction RetributionPrecombatActions
+### actions.precombat
+
+AddFunction RetributionPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=sleeper_surprise
@@ -175,12 +199,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=draenic_strength
-	UsePotionStrength()
 }

-AddFunction RetributionSingleActions
+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)
+	{
+		#snapshot_stats
+		#potion,name=draenic_strength
+		UsePotionStrength()
+	}
+}
+
+### actions.single
+
+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)
@@ -256,16 +289,41 @@ AddFunction RetributionSingleActions
 	Spell(holy_prism)
 }

+### Retribution icons.
+AddCheckBox(opt_paladin_retribution_aoe L(AOE) specialization=retribution default)
+
+AddIcon specialization=retribution help=shortcd enemies=1 checkbox=!opt_paladin_retribution_aoe
+{
+	RetributionDefaultShortCdActions()
+}
+
+AddIcon specialization=retribution help=shortcd checkbox=opt_paladin_retribution_aoe
+{
+	RetributionDefaultShortCdActions()
+}
+
 AddIcon specialization=retribution help=main enemies=1
 {
-	if not InCombat() RetributionPrecombatActions()
-	RetributionDefaultActions()
+	if not InCombat() RetributionPrecombatMainActions()
+	RetributionDefaultMainActions()
+}
+
+AddIcon specialization=retribution help=aoe checkbox=opt_paladin_retribution_aoe
+{
+	if not InCombat() RetributionPrecombatMainActions()
+	RetributionDefaultMainActions()
+}
+
+AddIcon specialization=retribution help=cd enemies=1 checkbox=!opt_paladin_retribution_aoe
+{
+	if not InCombat() RetributionPrecombatCdActions()
+	RetributionDefaultCdActions()
 }

-AddIcon specialization=retribution help=aoe
+AddIcon specialization=retribution help=cd checkbox=opt_paladin_retribution_aoe
 {
-	if not InCombat() RetributionPrecombatActions()
-	RetributionDefaultActions()
+	if not InCombat() RetributionPrecombatCdActions()
+	RetributionDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_priest_discipline_dmg.lua b/scripts/simulationcraft_priest_discipline_dmg.lua
index 94a80a8..6974c11 100644
--- a/scripts/simulationcraft_priest_discipline_dmg.lua
+++ b/scripts/simulationcraft_priest_discipline_dmg.lua
@@ -35,22 +35,10 @@ AddFunction InterruptActions
 	}
 }

-AddFunction DisciplineDefaultActions
+### actions.default
+
+AddFunction DisciplineDefaultMainActions
 {
-	#potion,name=draenic_intellect,if=buff.bloodlust.react|target.time_to_die<=40
-	if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() <= 40 UsePotionIntellect()
-	#mindbender,if=talent.mindbender.enabled
-	if Talent(mindbender_talent) Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled
-	if not Talent(mindbender_talent) Spell(shadowfiend)
-	#blood_fury
-	Spell(blood_fury_sp)
-	#berserking
-	Spell(berserking)
-	#arcane_torrent
-	Spell(arcane_torrent_mana)
-	#power_infusion,if=talent.power_infusion.enabled
-	if Talent(power_infusion_talent) Spell(power_infusion)
 	#shadow_word_pain,if=!ticking
 	if not target.DebuffPresent(shadow_word_pain_debuff) Spell(shadow_word_pain)
 	#penance
@@ -69,29 +57,79 @@ AddFunction DisciplineDefaultActions
 	Spell(shadow_word_pain)
 }

-AddFunction DisciplinePrecombatActions
+AddFunction DisciplineDefaultCdActions
+{
+	#potion,name=draenic_intellect,if=buff.bloodlust.react|target.time_to_die<=40
+	if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() <= 40 UsePotionIntellect()
+	#mindbender,if=talent.mindbender.enabled
+	if Talent(mindbender_talent) Spell(mindbender)
+	#shadowfiend,if=!talent.mindbender.enabled
+	if not Talent(mindbender_talent) Spell(shadowfiend)
+	#blood_fury
+	Spell(blood_fury_sp)
+	#berserking
+	Spell(berserking)
+	#arcane_torrent
+	Spell(arcane_torrent_mana)
+	#power_infusion,if=talent.power_infusion.enabled
+	if Talent(power_infusion_talent) Spell(power_infusion)
+}
+
+### actions.precombat
+
+AddFunction DisciplinePrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=calamari_crepes
 	#power_word_fortitude,if=!aura.stamina.up
 	if not BuffPresent(stamina_buff any=1) Spell(power_word_fortitude)
-	#snapshot_stats
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#smite
 	Spell(smite)
 }

+AddFunction DisciplinePrecombatCdActions
+{
+	unless not BuffPresent(stamina_buff any=1) and Spell(power_word_fortitude)
+	{
+		#snapshot_stats
+		#potion,name=draenic_intellect
+		UsePotionIntellect()
+	}
+}
+
+### Discipline icons.
+AddCheckBox(opt_priest_discipline_aoe L(AOE) specialization=discipline default)
+
+AddIcon specialization=discipline help=shortcd enemies=1 checkbox=!opt_priest_discipline_aoe
+{
+}
+
+AddIcon specialization=discipline help=shortcd checkbox=opt_priest_discipline_aoe
+{
+}
+
 AddIcon specialization=discipline help=main enemies=1
 {
-	if not InCombat() DisciplinePrecombatActions()
-	DisciplineDefaultActions()
+	if not InCombat() DisciplinePrecombatMainActions()
+	DisciplineDefaultMainActions()
+}
+
+AddIcon specialization=discipline help=aoe checkbox=opt_priest_discipline_aoe
+{
+	if not InCombat() DisciplinePrecombatMainActions()
+	DisciplineDefaultMainActions()
+}
+
+AddIcon specialization=discipline help=cd enemies=1 checkbox=!opt_priest_discipline_aoe
+{
+	if not InCombat() DisciplinePrecombatCdActions()
+	DisciplineDefaultCdActions()
 }

-AddIcon specialization=discipline help=aoe
+AddIcon specialization=discipline help=cd checkbox=opt_priest_discipline_aoe
 {
-	if not InCombat() DisciplinePrecombatActions()
-	DisciplineDefaultActions()
+	if not InCombat() DisciplinePrecombatCdActions()
+	DisciplineDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_priest_discipline_heal.lua b/scripts/simulationcraft_priest_discipline_heal.lua
index 4846059..a5c9160 100644
--- a/scripts/simulationcraft_priest_discipline_heal.lua
+++ b/scripts/simulationcraft_priest_discipline_heal.lua
@@ -41,24 +41,12 @@ AddFunction InterruptActions
 	}
 }

-AddFunction DisciplineDefaultActions
+### actions.default
+
+AddFunction DisciplineDefaultMainActions
 {
-	#mana_potion,if=mana.pct<=75
-	if ManaPercent() <= 75 UsePotionMana()
-	#blood_fury
-	Spell(blood_fury_sp)
-	#berserking
-	Spell(berserking)
-	#arcane_torrent
-	Spell(arcane_torrent_mana)
-	#power_infusion,if=talent.power_infusion.enabled
-	if Talent(power_infusion_talent) Spell(power_infusion)
 	#power_word_solace,if=talent.power_word_solace.enabled
 	if Talent(power_word_solace_talent) Spell(power_word_solace)
-	#mindbender,if=talent.mindbender.enabled&mana.pct<80
-	if Talent(mindbender_talent) and ManaPercent() < 80 Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled
-	if not Talent(mindbender_talent) Spell(shadowfiend)
 	#power_word_shield
 	Spell(power_word_shield)
 	#penance_heal,if=buff.borrowed_time.up
@@ -75,29 +63,83 @@ AddFunction DisciplineDefaultActions
 	Spell(heal)
 }

-AddFunction DisciplinePrecombatActions
+AddFunction DisciplineDefaultCdActions
+{
+	#mana_potion,if=mana.pct<=75
+	if ManaPercent() <= 75 UsePotionMana()
+	#blood_fury
+	Spell(blood_fury_sp)
+	#berserking
+	Spell(berserking)
+	#arcane_torrent
+	Spell(arcane_torrent_mana)
+	#power_infusion,if=talent.power_infusion.enabled
+	if Talent(power_infusion_talent) Spell(power_infusion)
+
+	unless Talent(power_word_solace_talent) and Spell(power_word_solace)
+	{
+		#mindbender,if=talent.mindbender.enabled&mana.pct<80
+		if Talent(mindbender_talent) and ManaPercent() < 80 Spell(mindbender)
+		#shadowfiend,if=!talent.mindbender.enabled
+		if not Talent(mindbender_talent) Spell(shadowfiend)
+	}
+}
+
+### actions.precombat
+
+AddFunction DisciplinePrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=blackrock_barbecue
 	#power_word_fortitude,if=!aura.stamina.up
 	if not BuffPresent(stamina_buff any=1) Spell(power_word_fortitude)
-	#snapshot_stats
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#prayer_of_mending
 	Spell(prayer_of_mending)
 }

+AddFunction DisciplinePrecombatCdActions
+{
+	unless not BuffPresent(stamina_buff any=1) and Spell(power_word_fortitude)
+	{
+		#snapshot_stats
+		#potion,name=draenic_intellect
+		UsePotionIntellect()
+	}
+}
+
+### Discipline icons.
+AddCheckBox(opt_priest_discipline_aoe L(AOE) specialization=discipline default)
+
+AddIcon specialization=discipline help=shortcd enemies=1 checkbox=!opt_priest_discipline_aoe
+{
+}
+
+AddIcon specialization=discipline help=shortcd checkbox=opt_priest_discipline_aoe
+{
+}
+
 AddIcon specialization=discipline help=main enemies=1
 {
-	if not InCombat() DisciplinePrecombatActions()
-	DisciplineDefaultActions()
+	if not InCombat() DisciplinePrecombatMainActions()
+	DisciplineDefaultMainActions()
+}
+
+AddIcon specialization=discipline help=aoe checkbox=opt_priest_discipline_aoe
+{
+	if not InCombat() DisciplinePrecombatMainActions()
+	DisciplineDefaultMainActions()
+}
+
+AddIcon specialization=discipline help=cd enemies=1 checkbox=!opt_priest_discipline_aoe
+{
+	if not InCombat() DisciplinePrecombatCdActions()
+	DisciplineDefaultCdActions()
 }

-AddIcon specialization=discipline help=aoe
+AddIcon specialization=discipline help=cd checkbox=opt_priest_discipline_aoe
 {
-	if not InCombat() DisciplinePrecombatActions()
-	DisciplineDefaultActions()
+	if not InCombat() DisciplinePrecombatCdActions()
+	DisciplineDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_priest_holy_dmg.lua b/scripts/simulationcraft_priest_holy_dmg.lua
index a0a6812..ffb468f 100644
--- a/scripts/simulationcraft_priest_holy_dmg.lua
+++ b/scripts/simulationcraft_priest_holy_dmg.lua
@@ -35,7 +35,34 @@ AddFunction InterruptActions
 	}
 }

-AddFunction HolyDefaultActions
+### actions.default
+
+AddFunction HolyDefaultMainActions
+{
+	#shadow_word_pain,cycle_targets=1,max_cycle_targets=5,if=miss_react&!ticking
+	if 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) Spell(shadow_word_pain)
+	#power_word_solace
+	Spell(power_word_solace)
+	#mind_sear,if=active_enemies>=4
+	if Enemies() >= 4 Spell(mind_sear)
+	#holy_fire
+	Spell(holy_fire)
+	#smite
+	Spell(smite)
+	#shadow_word_pain,moving=1
+	if Speed() > 0 Spell(shadow_word_pain)
+}
+
+AddFunction HolyDefaultShortCdActions
+{
+	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 Spell(shadow_word_pain) or Spell(power_word_solace) or Enemies() >= 4 and Spell(mind_sear) or Spell(holy_fire) or Spell(smite)
+	{
+		#holy_word,moving=1
+		if Speed() > 0 Spell(holy_word)
+	}
+}
+
+AddFunction HolyDefaultCdActions
 {
 	#potion,name=draenic_intellect,if=buff.bloodlust.react|target.time_to_die<=40
 	if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() <= 40 UsePotionIntellect()
@@ -51,47 +78,76 @@ AddFunction HolyDefaultActions
 	if not Talent(mindbender_talent) Spell(shadowfiend)
 	#mindbender,if=talent.mindbender.enabled
 	if Talent(mindbender_talent) Spell(mindbender)
-	#shadow_word_pain,cycle_targets=1,max_cycle_targets=5,if=miss_react&!ticking
-	if 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) Spell(shadow_word_pain)
-	#power_word_solace
-	Spell(power_word_solace)
-	#mind_sear,if=active_enemies>=4
-	if Enemies() >= 4 Spell(mind_sear)
-	#holy_fire
-	Spell(holy_fire)
-	#smite
-	Spell(smite)
-	#holy_word,moving=1
-	if Speed() > 0 Spell(holy_word)
-	#shadow_word_pain,moving=1
-	if Speed() > 0 Spell(shadow_word_pain)
 }

-AddFunction HolyPrecombatActions
+### actions.precombat
+
+AddFunction HolyPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=calamari_crepes
 	#power_word_fortitude,if=!aura.stamina.up
 	if not BuffPresent(stamina_buff any=1) Spell(power_word_fortitude)
-	#chakra_chastise
-	Spell(chakra_chastise)
-	#snapshot_stats
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#smite
 	Spell(smite)
 }

+AddFunction HolyPrecombatShortCdActions
+{
+	unless not BuffPresent(stamina_buff any=1) and Spell(power_word_fortitude)
+	{
+		#chakra_chastise
+		Spell(chakra_chastise)
+	}
+}
+
+AddFunction HolyPrecombatCdActions
+{
+	unless not BuffPresent(stamina_buff any=1) and Spell(power_word_fortitude) or Spell(chakra_chastise)
+	{
+		#snapshot_stats
+		#potion,name=draenic_intellect
+		UsePotionIntellect()
+	}
+}
+
+### Holy icons.
+AddCheckBox(opt_priest_holy_aoe L(AOE) specialization=holy default)
+
+AddIcon specialization=holy help=shortcd enemies=1 checkbox=!opt_priest_holy_aoe
+{
+	if not InCombat() HolyPrecombatShortCdActions()
+	HolyDefaultShortCdActions()
+}
+
+AddIcon specialization=holy help=shortcd checkbox=opt_priest_holy_aoe
+{
+	if not InCombat() HolyPrecombatShortCdActions()
+	HolyDefaultShortCdActions()
+}
+
 AddIcon specialization=holy help=main enemies=1
 {
-	if not InCombat() HolyPrecombatActions()
-	HolyDefaultActions()
+	if not InCombat() HolyPrecombatMainActions()
+	HolyDefaultMainActions()
+}
+
+AddIcon specialization=holy help=aoe checkbox=opt_priest_holy_aoe
+{
+	if not InCombat() HolyPrecombatMainActions()
+	HolyDefaultMainActions()
+}
+
+AddIcon specialization=holy help=cd enemies=1 checkbox=!opt_priest_holy_aoe
+{
+	if not InCombat() HolyPrecombatCdActions()
+	HolyDefaultCdActions()
 }

-AddIcon specialization=holy help=aoe
+AddIcon specialization=holy help=cd checkbox=opt_priest_holy_aoe
 {
-	if not InCombat() HolyPrecombatActions()
-	HolyDefaultActions()
+	if not InCombat() HolyPrecombatCdActions()
+	HolyDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_priest_holy_heal.lua b/scripts/simulationcraft_priest_holy_heal.lua
index 592c40a..53c8de4 100644
--- a/scripts/simulationcraft_priest_holy_heal.lua
+++ b/scripts/simulationcraft_priest_holy_heal.lua
@@ -41,40 +41,18 @@ AddFunction InterruptActions
 	}
 }

-AddFunction HolyDefaultActions
+### actions.default
+
+AddFunction HolyDefaultMainActions
 {
-	#mana_potion,if=mana.pct<=75
-	if ManaPercent() <= 75 UsePotionMana()
-	#blood_fury
-	Spell(blood_fury_sp)
-	#berserking
-	Spell(berserking)
-	#arcane_torrent
-	Spell(arcane_torrent_mana)
-	#power_infusion,if=talent.power_infusion.enabled
-	if Talent(power_infusion_talent) Spell(power_infusion)
-	#lightwell
-	Spell(lightwell)
 	#power_word_solace,if=talent.power_word_solace.enabled
 	if Talent(power_word_solace_talent) Spell(power_word_solace)
-	#mindbender,if=talent.mindbender.enabled&mana.pct<80
-	if Talent(mindbender_talent) and ManaPercent() < 80 Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled
-	if not Talent(mindbender_talent) Spell(shadowfiend)
 	#prayer_of_mending,if=buff.divine_insight.up
 	if BuffPresent(divine_insight_buff) Spell(prayer_of_mending)
 	#flash_heal,if=buff.surge_of_light.up
 	if BuffPresent(surge_of_light_buff) Spell(flash_heal)
 	#circle_of_healing
 	Spell(circle_of_healing)
-	#holy_word
-	Spell(holy_word)
-	#halo,if=talent.halo.enabled
-	if Talent(halo_talent) Spell(halo_heal)
-	#cascade,if=talent.cascade.enabled
-	if Talent(cascade_talent) Spell(cascade_heal)
-	#divine_star,if=talent.divine_star.enabled
-	if Talent(divine_star_talent) Spell(divine_star_heal)
 	#renew,if=!ticking
 	if not BuffPresent(renew_buff) Spell(renew)
 	#heal,if=buff.serendipity.react>=2&mana.pct>40
@@ -85,31 +63,113 @@ AddFunction HolyDefaultActions
 	Spell(heal)
 }

-AddFunction HolyPrecombatActions
+AddFunction HolyDefaultShortCdActions
+{
+	unless Talent(power_word_solace_talent) and Spell(power_word_solace) or BuffPresent(divine_insight_buff) and Spell(prayer_of_mending) or BuffPresent(surge_of_light_buff) and Spell(flash_heal) or Spell(circle_of_healing)
+	{
+		#holy_word
+		Spell(holy_word)
+		#halo,if=talent.halo.enabled
+		if Talent(halo_talent) Spell(halo_heal)
+		#cascade,if=talent.cascade.enabled
+		if Talent(cascade_talent) Spell(cascade_heal)
+		#divine_star,if=talent.divine_star.enabled
+		if Talent(divine_star_talent) Spell(divine_star_heal)
+	}
+}
+
+AddFunction HolyDefaultCdActions
+{
+	#mana_potion,if=mana.pct<=75
+	if ManaPercent() <= 75 UsePotionMana()
+	#blood_fury
+	Spell(blood_fury_sp)
+	#berserking
+	Spell(berserking)
+	#arcane_torrent
+	Spell(arcane_torrent_mana)
+	#power_infusion,if=talent.power_infusion.enabled
+	if Talent(power_infusion_talent) Spell(power_infusion)
+	#lightwell
+	Spell(lightwell)
+
+	unless Talent(power_word_solace_talent) and Spell(power_word_solace)
+	{
+		#mindbender,if=talent.mindbender.enabled&mana.pct<80
+		if Talent(mindbender_talent) and ManaPercent() < 80 Spell(mindbender)
+		#shadowfiend,if=!talent.mindbender.enabled
+		if not Talent(mindbender_talent) Spell(shadowfiend)
+	}
+}
+
+### actions.precombat
+
+AddFunction HolyPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=calamari_crepes
 	#power_word_fortitude,if=!aura.stamina.up
 	if not BuffPresent(stamina_buff any=1) Spell(power_word_fortitude)
-	#chakra_serenity
-	Spell(chakra_serenity)
-	#snapshot_stats
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#prayer_of_mending
 	Spell(prayer_of_mending)
 }

+AddFunction HolyPrecombatShortCdActions
+{
+	unless not BuffPresent(stamina_buff any=1) and Spell(power_word_fortitude)
+	{
+		#chakra_serenity
+		Spell(chakra_serenity)
+	}
+}
+
+AddFunction HolyPrecombatCdActions
+{
+	unless not BuffPresent(stamina_buff any=1) and Spell(power_word_fortitude) or Spell(chakra_serenity)
+	{
+		#snapshot_stats
+		#potion,name=draenic_intellect
+		UsePotionIntellect()
+	}
+}
+
+### Holy icons.
+AddCheckBox(opt_priest_holy_aoe L(AOE) specialization=holy default)
+
+AddIcon specialization=holy help=shortcd enemies=1 checkbox=!opt_priest_holy_aoe
+{
+	if not InCombat() HolyPrecombatShortCdActions()
+	HolyDefaultShortCdActions()
+}
+
+AddIcon specialization=holy help=shortcd checkbox=opt_priest_holy_aoe
+{
+	if not InCombat() HolyPrecombatShortCdActions()
+	HolyDefaultShortCdActions()
+}
+
 AddIcon specialization=holy help=main enemies=1
 {
-	if not InCombat() HolyPrecombatActions()
-	HolyDefaultActions()
+	if not InCombat() HolyPrecombatMainActions()
+	HolyDefaultMainActions()
+}
+
+AddIcon specialization=holy help=aoe checkbox=opt_priest_holy_aoe
+{
+	if not InCombat() HolyPrecombatMainActions()
+	HolyDefaultMainActions()
+}
+
+AddIcon specialization=holy help=cd enemies=1 checkbox=!opt_priest_holy_aoe
+{
+	if not InCombat() HolyPrecombatCdActions()
+	HolyDefaultCdActions()
 }

-AddIcon specialization=holy help=aoe
+AddIcon specialization=holy help=cd checkbox=opt_priest_holy_aoe
 {
-	if not InCombat() HolyPrecombatActions()
-	HolyDefaultActions()
+	if not InCombat() HolyPrecombatCdActions()
+	HolyDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_priest_shadow_as.lua b/scripts/simulationcraft_priest_shadow_as.lua
index 9332284..4bbd9fa 100644
--- a/scripts/simulationcraft_priest_shadow_as.lua
+++ b/scripts/simulationcraft_priest_shadow_as.lua
@@ -35,27 +35,53 @@ AddFunction InterruptActions
 	}
 }

-AddFunction ShadowDefaultActions
+### actions.default
+
+AddFunction ShadowDefaultMainActions
 {
 	#shadowform,if=!buff.shadowform.up
 	if not BuffPresent(shadowform_buff) Spell(shadowform)
-	#potion,name=draenic_intellect,if=buff.bloodlust.react|target.time_to_die<=40
-	if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() <= 40 UsePotionIntellect()
-	#power_infusion,if=talent.power_infusion.enabled
-	if Talent(power_infusion_talent) Spell(power_infusion)
-	#blood_fury
-	Spell(blood_fury_sp)
-	#berserking
-	Spell(berserking)
-	#arcane_torrent
-	Spell(arcane_torrent_mana)
 	#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
+{
+	unless not BuffPresent(shadowform_buff) and Spell(shadowform)
+	{
+		#call_action_list,name=pvp_dispersion,if=set_bonus.pvp_2pc
+		if ArmorSetBonus(PVP 2) ShadowPvpDispersionShortCdActions()
+		#call_action_list,name=decision
+		ShadowDecisionShortCdActions()
+	}
 }

-AddFunction ShadowCopActions
+AddFunction ShadowDefaultCdActions
+{
+	unless not BuffPresent(shadowform_buff) and Spell(shadowform)
+	{
+		#potion,name=draenic_intellect,if=buff.bloodlust.react|target.time_to_die<=40
+		if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() <= 40 UsePotionIntellect()
+		#power_infusion,if=talent.power_infusion.enabled
+		if Talent(power_infusion_talent) Spell(power_infusion)
+		#blood_fury
+		Spell(blood_fury_sp)
+		#berserking
+		Spell(berserking)
+		#arcane_torrent
+		Spell(arcane_torrent_mana)
+		#call_action_list,name=pvp_dispersion,if=set_bonus.pvp_2pc
+		if ArmorSetBonus(PVP 2) ShadowPvpDispersionCdActions()
+		#call_action_list,name=decision
+		ShadowDecisionCdActions()
+	}
+}
+
+### actions.cop
+
+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)
@@ -67,16 +93,6 @@ AddFunction ShadowCopActions
 	if Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 Spell(mind_blast)
 	#shadow_word_death,if=target.health.pct<20,cycle_targets=1
 	if target.HealthPercent() < 20 Spell(shadow_word_death)
-	#mindbender,if=talent.mindbender.enabled
-	if Talent(mindbender_talent) Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled
-	if not Talent(mindbender_talent) Spell(shadowfiend)
-	#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)
-	#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
-	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)
 	#shadow_word_pain,if=miss_react&!ticking&active_enemies<=5&primary_target=0,cycle_targets=1,max_cycle_targets=5
 	if 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 Spell(shadow_word_pain)
 	#vampiric_touch,if=remains<cast_time&miss_react&active_enemies<=5&primary_target=0,cycle_targets=1,max_cycle_targets=5
@@ -95,17 +111,47 @@ AddFunction ShadowCopActions
 	if Speed() > 0 Spell(shadow_word_death)
 	#mind_blast,if=buff.shadowy_insight.react&cooldown_react,moving=1
 	if BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Speed() > 0 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)
-	#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
-	if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
-	#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
-	if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
 	#shadow_word_pain,if=primary_target=0,moving=1,cycle_targets=1
 	if Speed() > 0 and 0 == 0 Spell(shadow_word_pain)
 }

-AddFunction ShadowCopDotweaveActions
+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)
+	{
+		#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)
+		#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
+		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)
+
+		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)
+			#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
+			if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
+			#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
+			if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
+		}
+	}
+}
+
+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)
+	{
+		#mindbender,if=talent.mindbender.enabled
+		if Talent(mindbender_talent) Spell(mindbender)
+		#shadowfiend,if=!talent.mindbender.enabled
+		if not Talent(mindbender_talent) Spell(shadowfiend)
+	}
+}
+
+### actions.cop_dotweave
+
+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)
@@ -117,10 +163,6 @@ AddFunction ShadowCopDotweaveActions
 	if Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() <= 2 Spell(mind_blast)
 	#mind_blast,if=shadow_orb<=4&cooldown_react
 	if ShadowOrbs() <= 4 and not SpellCooldown(mind_blast) > 0 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)
-	#mindbender,if=talent.mindbender.enabled&!buff.shadow_word_insanity.remains
-	if Talent(mindbender_talent) and not BuffPresent(shadow_word_insanity_buff) Spell(mindbender)
 	#shadow_word_pain,if=shadow_orb=4&set_bonus.tier17_2pc&!target.dot.shadow_word_pain.ticking&!target.dot.devouring_plague.ticking&cooldown.mind_blast.remains<1.2*gcd&cooldown.mind_blast.remains>0.2*gcd
 	if 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() Spell(shadow_word_pain)
 	#shadow_word_pain,if=shadow_orb=5&!target.dot.devouring_plague.ticking&!target.dot.shadow_word_pain.ticking
@@ -133,12 +175,6 @@ AddFunction ShadowCopDotweaveActions
 	if 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) Spell(shadow_word_pain)
 	#vampiric_touch,if=shadow_orb>=2&target.dot.vampiric_touch.remains>=5&cooldown.mind_blast.remains>0.5*gcd&buff.bloodlust.up&!set_bonus.tier17_2pc
 	if 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) 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)
-	#divine_star,if=cooldown.mind_blast.remains>0.5&gcd&talent.divine_star.enabled&(active_enemies>1|target.distance<=24)
-	if SpellCooldown(mind_blast) > 0.5 and GCD() and Talent(divine_star_talent) and { Enemies() > 1 or target.Distance() <= 24 } Spell(divine_star_caster)
-	#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)
 	#shadow_word_pain,if=primary_target=0&(!ticking|remains<=18*0.3),cycle_targets=1,max_cycle_targets=5
 	if 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 } Spell(shadow_word_pain)
 	#vampiric_touch,if=primary_target=0&(!ticking|remains<=15*0.3),cycle_targets=1,max_cycle_targets=5
@@ -153,17 +189,47 @@ AddFunction ShadowCopDotweaveActions
 	Spell(mind_spike)
 	#shadow_word_death,moving=1
 	if Speed() > 0 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)
-	#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
-	if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
-	#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
-	if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
 	#shadow_word_pain,moving=1
 	if Speed() > 0 Spell(shadow_word_pain)
 }

-AddFunction ShadowCopMfiActions
+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)
+	{
+		#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)
+		#divine_star,if=cooldown.mind_blast.remains>0.5&gcd&talent.divine_star.enabled&(active_enemies>1|target.distance<=24)
+		if SpellCooldown(mind_blast) > 0.5 and GCD() and Talent(divine_star_talent) and { Enemies() > 1 or target.Distance() <= 24 } Spell(divine_star_caster)
+		#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)
+		{
+			#halo,if=talent.halo.enabled&target.distance<=30,moving=1
+			if Talent(halo_talent) and target.Distance() <= 30 and Speed() > 0 Spell(halo_caster)
+			#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
+			if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
+			#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
+			if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
+		}
+	}
+}
+
+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)
+	{
+		#shadowfiend,if=!talent.mindbender.enabled&!buff.shadow_word_insanity.remains
+		if not Talent(mindbender_talent) and not BuffPresent(shadow_word_insanity_buff) Spell(shadowfiend)
+		#mindbender,if=talent.mindbender.enabled&!buff.shadow_word_insanity.remains
+		if Talent(mindbender_talent) and not BuffPresent(shadow_word_insanity_buff) Spell(mindbender)
+	}
+}
+
+### actions.cop_mfi
+
+AddFunction ShadowCopMfiMainActions
 {
 	#devouring_plague,if=shadow_orb=5
 	if ShadowOrbs() == 5 Spell(devouring_plague)
@@ -175,10 +241,6 @@ AddFunction ShadowCopMfiActions
 	if target.HealthPercent() < 20 Spell(shadow_word_death)
 	#devouring_plague,if=shadow_orb>=3&(cooldown.mind_blast.remains<gcd*1.0|target.health.pct<20&cooldown.shadow_word_death.remains<gcd*1.0)
 	if ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) < GCD() * 1 or target.HealthPercent() < 20 and SpellCooldown(shadow_word_death) < GCD() * 1 } Spell(devouring_plague)
-	#mindbender,if=talent.mindbender.enabled
-	if Talent(mindbender_talent) Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled
-	if not Talent(mindbender_talent) Spell(shadowfiend)
 	#shadow_word_pain,if=remains<(18*0.3)&miss_react&active_enemies<=5&primary_target=0,cycle_targets=1,max_cycle_targets=5
 	if 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 Spell(shadow_word_pain)
 	#vampiric_touch,if=remains<(15*0.3+cast_time)&miss_react&active_enemies<=5&primary_target=0,cycle_targets=1,max_cycle_targets=5
@@ -187,12 +249,6 @@ AddFunction ShadowCopMfiActions
 	if BuffRemaining(shadow_word_insanity_buff) < 0.5 * GCD() and Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) Spell(insanity)
 	#insanity,if=active_enemies<=2,chain=1,interrupt_if=(cooldown.mind_blast.remains<=0.1|(cooldown.shadow_word_death.remains<=0.1*target.health.pct<20))
 	if Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) 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)
-	#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
-	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)
 	#mind_sear,if=active_enemies>=6,chain=1,interrupt_if=(cooldown.mind_blast.remains<=0.1|cooldown.shadow_word_death.remains<=0.1)
 	if Enemies() >= 6 Spell(mind_sear)
 	#mind_spike
@@ -201,36 +257,92 @@ AddFunction ShadowCopMfiActions
 	if Speed() > 0 Spell(shadow_word_death)
 	#mind_blast,if=buff.shadowy_insight.react&cooldown_react,moving=1
 	if BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Speed() > 0 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)
-	#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
-	if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
-	#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
-	if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
 	#shadow_word_pain,if=primary_target=0,moving=1,cycle_targets=1
 	if Speed() > 0 and 0 == 0 Spell(shadow_word_pain)
 }

-AddFunction ShadowDecisionActions
+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)
+	{
+		#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)
+		#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
+		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)
+
+		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)
+			#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
+			if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
+			#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
+			if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
+		}
+	}
+}
+
+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)
+	{
+		#mindbender,if=talent.mindbender.enabled
+		if Talent(mindbender_talent) Spell(mindbender)
+		#shadowfiend,if=!talent.mindbender.enabled
+		if not Talent(mindbender_talent) Spell(shadowfiend)
+	}
+}
+
+### actions.decision
+
+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 ShadowMainActions
+AddFunction ShadowDecisionShortCdActions
+{
+	#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 ShadowCopDotweaveShortCdActions()
+	#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 ShadowCopMfiShortCdActions()
+	#call_action_list,name=cop,if=talent.clarity_of_power.enabled
+	if Talent(clarity_of_power_talent) ShadowCopShortCdActions()
+	#call_action_list,name=vent,if=talent.void_entropy.enabled
+	if Talent(void_entropy_talent) ShadowVentShortCdActions()
+	#call_action_list,name=main
+	ShadowMainShortCdActions()
+}
+
+AddFunction ShadowDecisionCdActions
+{
+	#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 ShadowCopDotweaveCdActions()
+	#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 ShadowCopMfiCdActions()
+	#call_action_list,name=cop,if=talent.clarity_of_power.enabled
+	if Talent(clarity_of_power_talent) ShadowCopCdActions()
+	#call_action_list,name=vent,if=talent.void_entropy.enabled
+	if Talent(void_entropy_talent) ShadowVentCdActions()
+	#call_action_list,name=main
+	ShadowMainCdActions()
+}
+
+### actions.main
+
+AddFunction ShadowMainMainActions
 {
-	#mindbender,if=talent.mindbender.enabled
-	if Talent(mindbender_talent) Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled
-	if not Talent(mindbender_talent) Spell(shadowfiend)
 	#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)
 	#mind_blast,if=glyph.mind_harvest.enabled&shadow_orb<=2&active_enemies<=5&cooldown_react
@@ -251,12 +363,6 @@ AddFunction ShadowMainActions
 	if BuffRemaining(shadow_word_insanity_buff) < 0.5 * GCD() and Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) Spell(insanity)
 	#insanity,chain=1,if=active_enemies<=2,interrupt_if=(cooldown.mind_blast.remains<=0.1|cooldown.shadow_word_death.remains<=0.1|shadow_orb=5)
 	if Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) 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)
-	#cascade,if=talent.cascade.enabled&active_enemies>2&target.distance<=40
-	if Talent(cascade_talent) and Enemies() > 2 and target.Distance() <= 40 Spell(cascade_caster)
-	#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)
 	#shadow_word_pain,if=talent.auspicious_spirits.enabled&remains<(18*0.3)&miss_react,cycle_targets=1
 	if Talent(auspicious_spirits_talent) and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.3 and True(miss_react) Spell(shadow_word_pain)
 	#shadow_word_pain,if=!talent.auspicious_spirits.enabled&remains<(18*0.3)&miss_react&active_enemies<=5,cycle_targets=1,max_cycle_targets=5
@@ -267,12 +373,6 @@ AddFunction ShadowMainActions
 	if not Talent(void_entropy_talent) and ShadowOrbs() >= 3 and target.TicksRemaining(devouring_plague_debuff) < 2 Spell(devouring_plague)
 	#mind_spike,if=active_enemies<=5&buff.surge_of_darkness.react=3
 	if Enemies() <= 5 and BuffStacks(surge_of_darkness_buff) == 3 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)
-	#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
-	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
 	{
@@ -281,8 +381,6 @@ AddFunction ShadowMainActions
 		{
 			#mind_spike,if=buff.surge_of_darkness.react&active_enemies<=5
 			if BuffPresent(surge_of_darkness_buff) and Enemies() <= 5 Spell(mind_spike)
-			#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)
 			#mind_sear,chain=1,if=active_enemies>=4,interrupt_if=(cooldown.mind_blast.remains<=0.1|cooldown.shadow_word_death.remains<=0.1|shadow_orb=5)
 			if Enemies() >= 4 Spell(mind_sear)
 			#shadow_word_pain,if=shadow_orb>=2&ticks_remain<=3&talent.insanity.enabled
@@ -293,10 +391,6 @@ AddFunction ShadowMainActions
 			Spell(mind_flay)
 			#mind_blast,moving=1,if=buff.shadowy_insight.react&cooldown_react
 			if Speed() > 0 and BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 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)
-			#cascade,moving=1,if=talent.cascade.enabled&target.distance<=40
-			if Speed() > 0 and Talent(cascade_talent) and target.Distance() <= 40 Spell(cascade_caster)
 			#shadow_word_death,moving=1
 			if Speed() > 0 Spell(shadow_word_death)
 			#shadow_word_pain,moving=1,cycle_targets=1
@@ -305,7 +399,61 @@ AddFunction ShadowMainActions
 	}
 }

-AddFunction ShadowPrecombatActions
+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)
+	{
+		#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)
+		#cascade,if=talent.cascade.enabled&active_enemies>2&target.distance<=40
+		if Talent(cascade_talent) and Enemies() > 2 and target.Distance() <= 40 Spell(cascade_caster)
+		#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)
+		{
+			#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)
+			#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
+			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
+			{
+				#wait,sec=cooldown.mind_blast.remains,if=cooldown.mind_blast.remains<0.5&cooldown.mind_blast.remains&active_enemies<=1
+				unless SpellCooldown(mind_blast) < 0.5 and SpellCooldown(mind_blast) > 0 and Enemies() <= 1 and SpellCooldown(mind_blast) > 0
+				{
+					unless BuffPresent(surge_of_darkness_buff) and Enemies() <= 5 and Spell(mind_spike)
+					{
+						#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)
+						{
+							#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)
+							#cascade,moving=1,if=talent.cascade.enabled&target.distance<=40
+							if Speed() > 0 and Talent(cascade_talent) and target.Distance() <= 40 Spell(cascade_caster)
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+AddFunction ShadowMainCdActions
+{
+	#mindbender,if=talent.mindbender.enabled
+	if Talent(mindbender_talent) Spell(mindbender)
+	#shadowfiend,if=!talent.mindbender.enabled
+	if not Talent(mindbender_talent) Spell(shadowfiend)
+}
+
+### actions.precombat
+
+AddFunction ShadowPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=blackrock_barbecue
@@ -313,29 +461,52 @@ 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
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#vampiric_touch
 	Spell(vampiric_touch)
 }

-AddFunction ShadowPvpDispersionActions
+AddFunction ShadowPrecombatCdActions
+{
+	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()
+	}
+}
+
+### actions.pvp_dispersion
+
+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
+	ShadowDecisionMainActions()
+}
+
+AddFunction ShadowPvpDispersionShortCdActions
+{
+	#call_action_list,name=decision,if=cooldown.dispersion.remains>0
+	if SpellCooldown(dispersion) > 0 ShadowDecisionShortCdActions()
+	#call_action_list,name=decision
+	ShadowDecisionShortCdActions()
+}
+
+AddFunction ShadowPvpDispersionCdActions
+{
+	#call_action_list,name=decision,if=cooldown.dispersion.remains>0
+	if SpellCooldown(dispersion) > 0 ShadowDecisionCdActions()
 	#dispersion,interrupt=1
 	Spell(dispersion)
 	#call_action_list,name=decision
-	ShadowDecisionActions()
+	ShadowDecisionCdActions()
 }

-AddFunction ShadowVentActions
+### actions.vent
+
+AddFunction ShadowVentMainActions
 {
-	#mindbender,if=talent.mindbender.enabled&cooldown.mind_blast.remains>=gcd
-	if Talent(mindbender_talent) and SpellCooldown(mind_blast) >= GCD() Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled&cooldown.mind_blast.remains>=gcd
-	if not Talent(mindbender_talent) and SpellCooldown(mind_blast) >= GCD() Spell(shadowfiend)
 	#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)
 	#void_entropy,if=!dot.void_entropy.ticking&shadow_orb=5&active_enemies>=1&target.time_to_die>60,cycle_targets=1,max_cycle_targets=(60%(cooldown.mind_blast.duration*3*spell_haste))
@@ -348,8 +519,6 @@ AddFunction ShadowVentActions
 	if ShadowOrbs() == 5 and target.DebuffRemaining(void_entropy_debuff) < 20 Spell(devouring_plague)
 	#devouring_plague,if=shadow_orb=5&dot.void_entropy.remains,cycle_targets=1
 	if ShadowOrbs() == 5 and target.DebuffRemaining(void_entropy_debuff) 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)
 	#mind_blast,if=glyph.mind_harvest.enabled&mind_harvest=0&shadow_orb<=2,cycle_targets=1
 	if Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() <= 2 Spell(mind_blast)
 	#devouring_plague,if=glyph.mind_harvest.enabled&mind_harvest=0&shadow_orb>=3,cycle_targets=1
@@ -370,12 +539,6 @@ AddFunction ShadowVentActions
 	if 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) Spell(shadow_word_pain)
 	#vampiric_touch,if=remains<(15*0.35)&miss_react,cycle_targets=1,max_cycle_targets=5
 	if DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and target.DebuffRemaining(vampiric_touch_debuff) < 15 * 0.35 and True(miss_react) 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)
-	#cascade,if=talent.cascade.enabled&target.distance<=40&cooldown.mind_blast.remains>0.5*gcd
-	if Talent(cascade_talent) and target.Distance() <= 40 and SpellCooldown(mind_blast) > 0.5 * GCD() Spell(cascade_caster)
-	#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)
 	#mind_spike,if=active_enemies<=5&buff.surge_of_darkness.up&cooldown_react&cooldown.mind_blast.remains>0.5*gcd
 	if Enemies() <= 5 and BuffPresent(surge_of_darkness_buff) and not SpellCooldown(mind_spike) > 0 and SpellCooldown(mind_blast) > 0.5 * GCD() Spell(mind_spike)
 	#mind_sear,chain=1,if=active_enemies>=3&cooldown.mind_blast.remains>0.5*gcd,interrupt_if=(cooldown.mind_blast.remains<=0.1|cooldown.shadow_word_death.remains<=0.1)
@@ -386,26 +549,82 @@ AddFunction ShadowVentActions
 	if Speed() > 0 Spell(shadow_word_death)
 	#mind_blast,moving=1,if=buff.shadowy_insight.react&cooldown_react
 	if Speed() > 0 and BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 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)
-	#cascade,moving=1,if=talent.cascade.enabled&target.distance<=40
-	if Speed() > 0 and Talent(cascade_talent) and target.Distance() <= 40 Spell(cascade_caster)
 	#shadow_word_death,moving=1
 	if Speed() > 0 Spell(shadow_word_death)
 	#shadow_word_pain,moving=1,cycle_targets=1
 	if Speed() > 0 Spell(shadow_word_pain)
 }

+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)
+	{
+		#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)
+		{
+			#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)
+			#cascade,if=talent.cascade.enabled&target.distance<=40&cooldown.mind_blast.remains>0.5*gcd
+			if Talent(cascade_talent) and target.Distance() <= 40 and SpellCooldown(mind_blast) > 0.5 * GCD() Spell(cascade_caster)
+			#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)
+			{
+				#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)
+				#cascade,moving=1,if=talent.cascade.enabled&target.distance<=40
+				if Speed() > 0 and Talent(cascade_talent) and target.Distance() <= 40 Spell(cascade_caster)
+			}
+		}
+	}
+}
+
+AddFunction ShadowVentCdActions
+{
+	#mindbender,if=talent.mindbender.enabled&cooldown.mind_blast.remains>=gcd
+	if Talent(mindbender_talent) and SpellCooldown(mind_blast) >= GCD() Spell(mindbender)
+	#shadowfiend,if=!talent.mindbender.enabled&cooldown.mind_blast.remains>=gcd
+	if not Talent(mindbender_talent) and SpellCooldown(mind_blast) >= GCD() Spell(shadowfiend)
+}
+
+### Shadow icons.
+AddCheckBox(opt_priest_shadow_aoe L(AOE) specialization=shadow default)
+
+AddIcon specialization=shadow help=shortcd enemies=1 checkbox=!opt_priest_shadow_aoe
+{
+	ShadowDefaultShortCdActions()
+}
+
+AddIcon specialization=shadow help=shortcd checkbox=opt_priest_shadow_aoe
+{
+	ShadowDefaultShortCdActions()
+}
+
 AddIcon specialization=shadow help=main enemies=1
 {
-	if not InCombat() ShadowPrecombatActions()
-	ShadowDefaultActions()
+	if not InCombat() ShadowPrecombatMainActions()
+	ShadowDefaultMainActions()
+}
+
+AddIcon specialization=shadow help=aoe checkbox=opt_priest_shadow_aoe
+{
+	if not InCombat() ShadowPrecombatMainActions()
+	ShadowDefaultMainActions()
+}
+
+AddIcon specialization=shadow help=cd enemies=1 checkbox=!opt_priest_shadow_aoe
+{
+	if not InCombat() ShadowPrecombatCdActions()
+	ShadowDefaultCdActions()
 }

-AddIcon specialization=shadow help=aoe
+AddIcon specialization=shadow help=cd checkbox=opt_priest_shadow_aoe
 {
-	if not InCombat() ShadowPrecombatActions()
-	ShadowDefaultActions()
+	if not InCombat() ShadowPrecombatCdActions()
+	ShadowDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_priest_shadow_cop.lua b/scripts/simulationcraft_priest_shadow_cop.lua
index 382d719..09d7ea4 100644
--- a/scripts/simulationcraft_priest_shadow_cop.lua
+++ b/scripts/simulationcraft_priest_shadow_cop.lua
@@ -35,27 +35,53 @@ AddFunction InterruptActions
 	}
 }

-AddFunction ShadowDefaultActions
+### actions.default
+
+AddFunction ShadowDefaultMainActions
 {
 	#shadowform,if=!buff.shadowform.up
 	if not BuffPresent(shadowform_buff) Spell(shadowform)
-	#potion,name=draenic_intellect,if=buff.bloodlust.react|target.time_to_die<=40
-	if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() <= 40 UsePotionIntellect()
-	#power_infusion,if=talent.power_infusion.enabled
-	if Talent(power_infusion_talent) Spell(power_infusion)
-	#blood_fury
-	Spell(blood_fury_sp)
-	#berserking
-	Spell(berserking)
-	#arcane_torrent
-	Spell(arcane_torrent_mana)
 	#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
+{
+	unless not BuffPresent(shadowform_buff) and Spell(shadowform)
+	{
+		#call_action_list,name=pvp_dispersion,if=set_bonus.pvp_2pc
+		if ArmorSetBonus(PVP 2) ShadowPvpDispersionShortCdActions()
+		#call_action_list,name=decision
+		ShadowDecisionShortCdActions()
+	}
 }

-AddFunction ShadowCopActions
+AddFunction ShadowDefaultCdActions
+{
+	unless not BuffPresent(shadowform_buff) and Spell(shadowform)
+	{
+		#potion,name=draenic_intellect,if=buff.bloodlust.react|target.time_to_die<=40
+		if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() <= 40 UsePotionIntellect()
+		#power_infusion,if=talent.power_infusion.enabled
+		if Talent(power_infusion_talent) Spell(power_infusion)
+		#blood_fury
+		Spell(blood_fury_sp)
+		#berserking
+		Spell(berserking)
+		#arcane_torrent
+		Spell(arcane_torrent_mana)
+		#call_action_list,name=pvp_dispersion,if=set_bonus.pvp_2pc
+		if ArmorSetBonus(PVP 2) ShadowPvpDispersionCdActions()
+		#call_action_list,name=decision
+		ShadowDecisionCdActions()
+	}
+}
+
+### actions.cop
+
+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)
@@ -67,16 +93,6 @@ AddFunction ShadowCopActions
 	if Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 Spell(mind_blast)
 	#shadow_word_death,if=target.health.pct<20,cycle_targets=1
 	if target.HealthPercent() < 20 Spell(shadow_word_death)
-	#mindbender,if=talent.mindbender.enabled
-	if Talent(mindbender_talent) Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled
-	if not Talent(mindbender_talent) Spell(shadowfiend)
-	#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)
-	#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
-	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)
 	#shadow_word_pain,if=miss_react&!ticking&active_enemies<=5&primary_target=0,cycle_targets=1,max_cycle_targets=5
 	if 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 Spell(shadow_word_pain)
 	#vampiric_touch,if=remains<cast_time&miss_react&active_enemies<=5&primary_target=0,cycle_targets=1,max_cycle_targets=5
@@ -95,17 +111,47 @@ AddFunction ShadowCopActions
 	if Speed() > 0 Spell(shadow_word_death)
 	#mind_blast,if=buff.shadowy_insight.react&cooldown_react,moving=1
 	if BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Speed() > 0 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)
-	#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
-	if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
-	#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
-	if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
 	#shadow_word_pain,if=primary_target=0,moving=1,cycle_targets=1
 	if Speed() > 0 and 0 == 0 Spell(shadow_word_pain)
 }

-AddFunction ShadowCopDotweaveActions
+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)
+	{
+		#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)
+		#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
+		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)
+
+		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)
+			#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
+			if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
+			#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
+			if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
+		}
+	}
+}
+
+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)
+	{
+		#mindbender,if=talent.mindbender.enabled
+		if Talent(mindbender_talent) Spell(mindbender)
+		#shadowfiend,if=!talent.mindbender.enabled
+		if not Talent(mindbender_talent) Spell(shadowfiend)
+	}
+}
+
+### actions.cop_dotweave
+
+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)
@@ -117,10 +163,6 @@ AddFunction ShadowCopDotweaveActions
 	if Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() <= 2 Spell(mind_blast)
 	#mind_blast,if=shadow_orb<=4&cooldown_react
 	if ShadowOrbs() <= 4 and not SpellCooldown(mind_blast) > 0 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)
-	#mindbender,if=talent.mindbender.enabled&!buff.shadow_word_insanity.remains
-	if Talent(mindbender_talent) and not BuffPresent(shadow_word_insanity_buff) Spell(mindbender)
 	#shadow_word_pain,if=shadow_orb=4&set_bonus.tier17_2pc&!target.dot.shadow_word_pain.ticking&!target.dot.devouring_plague.ticking&cooldown.mind_blast.remains<1.2*gcd&cooldown.mind_blast.remains>0.2*gcd
 	if 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() Spell(shadow_word_pain)
 	#shadow_word_pain,if=shadow_orb=5&!target.dot.devouring_plague.ticking&!target.dot.shadow_word_pain.ticking
@@ -133,12 +175,6 @@ AddFunction ShadowCopDotweaveActions
 	if 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) Spell(shadow_word_pain)
 	#vampiric_touch,if=shadow_orb>=2&target.dot.vampiric_touch.remains>=5&cooldown.mind_blast.remains>0.5*gcd&buff.bloodlust.up&!set_bonus.tier17_2pc
 	if 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) 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)
-	#divine_star,if=cooldown.mind_blast.remains>0.5&gcd&talent.divine_star.enabled&(active_enemies>1|target.distance<=24)
-	if SpellCooldown(mind_blast) > 0.5 and GCD() and Talent(divine_star_talent) and { Enemies() > 1 or target.Distance() <= 24 } Spell(divine_star_caster)
-	#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)
 	#shadow_word_pain,if=primary_target=0&(!ticking|remains<=18*0.3),cycle_targets=1,max_cycle_targets=5
 	if 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 } Spell(shadow_word_pain)
 	#vampiric_touch,if=primary_target=0&(!ticking|remains<=15*0.3),cycle_targets=1,max_cycle_targets=5
@@ -153,17 +189,47 @@ AddFunction ShadowCopDotweaveActions
 	Spell(mind_spike)
 	#shadow_word_death,moving=1
 	if Speed() > 0 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)
-	#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
-	if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
-	#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
-	if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
 	#shadow_word_pain,moving=1
 	if Speed() > 0 Spell(shadow_word_pain)
 }

-AddFunction ShadowCopMfiActions
+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)
+	{
+		#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)
+		#divine_star,if=cooldown.mind_blast.remains>0.5&gcd&talent.divine_star.enabled&(active_enemies>1|target.distance<=24)
+		if SpellCooldown(mind_blast) > 0.5 and GCD() and Talent(divine_star_talent) and { Enemies() > 1 or target.Distance() <= 24 } Spell(divine_star_caster)
+		#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)
+		{
+			#halo,if=talent.halo.enabled&target.distance<=30,moving=1
+			if Talent(halo_talent) and target.Distance() <= 30 and Speed() > 0 Spell(halo_caster)
+			#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
+			if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
+			#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
+			if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
+		}
+	}
+}
+
+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)
+	{
+		#shadowfiend,if=!talent.mindbender.enabled&!buff.shadow_word_insanity.remains
+		if not Talent(mindbender_talent) and not BuffPresent(shadow_word_insanity_buff) Spell(shadowfiend)
+		#mindbender,if=talent.mindbender.enabled&!buff.shadow_word_insanity.remains
+		if Talent(mindbender_talent) and not BuffPresent(shadow_word_insanity_buff) Spell(mindbender)
+	}
+}
+
+### actions.cop_mfi
+
+AddFunction ShadowCopMfiMainActions
 {
 	#devouring_plague,if=shadow_orb=5
 	if ShadowOrbs() == 5 Spell(devouring_plague)
@@ -175,10 +241,6 @@ AddFunction ShadowCopMfiActions
 	if target.HealthPercent() < 20 Spell(shadow_word_death)
 	#devouring_plague,if=shadow_orb>=3&(cooldown.mind_blast.remains<gcd*1.0|target.health.pct<20&cooldown.shadow_word_death.remains<gcd*1.0)
 	if ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) < GCD() * 1 or target.HealthPercent() < 20 and SpellCooldown(shadow_word_death) < GCD() * 1 } Spell(devouring_plague)
-	#mindbender,if=talent.mindbender.enabled
-	if Talent(mindbender_talent) Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled
-	if not Talent(mindbender_talent) Spell(shadowfiend)
 	#shadow_word_pain,if=remains<(18*0.3)&miss_react&active_enemies<=5&primary_target=0,cycle_targets=1,max_cycle_targets=5
 	if 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 Spell(shadow_word_pain)
 	#vampiric_touch,if=remains<(15*0.3+cast_time)&miss_react&active_enemies<=5&primary_target=0,cycle_targets=1,max_cycle_targets=5
@@ -187,12 +249,6 @@ AddFunction ShadowCopMfiActions
 	if BuffRemaining(shadow_word_insanity_buff) < 0.5 * GCD() and Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) Spell(insanity)
 	#insanity,if=active_enemies<=2,chain=1,interrupt_if=(cooldown.mind_blast.remains<=0.1|(cooldown.shadow_word_death.remains<=0.1*target.health.pct<20))
 	if Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) 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)
-	#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
-	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)
 	#mind_sear,if=active_enemies>=6,chain=1,interrupt_if=(cooldown.mind_blast.remains<=0.1|cooldown.shadow_word_death.remains<=0.1)
 	if Enemies() >= 6 Spell(mind_sear)
 	#mind_spike
@@ -201,36 +257,92 @@ AddFunction ShadowCopMfiActions
 	if Speed() > 0 Spell(shadow_word_death)
 	#mind_blast,if=buff.shadowy_insight.react&cooldown_react,moving=1
 	if BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Speed() > 0 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)
-	#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
-	if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
-	#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
-	if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
 	#shadow_word_pain,if=primary_target=0,moving=1,cycle_targets=1
 	if Speed() > 0 and 0 == 0 Spell(shadow_word_pain)
 }

-AddFunction ShadowDecisionActions
+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)
+	{
+		#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)
+		#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
+		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)
+
+		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)
+			#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
+			if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
+			#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
+			if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
+		}
+	}
+}
+
+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)
+	{
+		#mindbender,if=talent.mindbender.enabled
+		if Talent(mindbender_talent) Spell(mindbender)
+		#shadowfiend,if=!talent.mindbender.enabled
+		if not Talent(mindbender_talent) Spell(shadowfiend)
+	}
+}
+
+### actions.decision
+
+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 ShadowMainActions
+AddFunction ShadowDecisionShortCdActions
+{
+	#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 ShadowCopDotweaveShortCdActions()
+	#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 ShadowCopMfiShortCdActions()
+	#call_action_list,name=cop,if=talent.clarity_of_power.enabled
+	if Talent(clarity_of_power_talent) ShadowCopShortCdActions()
+	#call_action_list,name=vent,if=talent.void_entropy.enabled
+	if Talent(void_entropy_talent) ShadowVentShortCdActions()
+	#call_action_list,name=main
+	ShadowMainShortCdActions()
+}
+
+AddFunction ShadowDecisionCdActions
+{
+	#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 ShadowCopDotweaveCdActions()
+	#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 ShadowCopMfiCdActions()
+	#call_action_list,name=cop,if=talent.clarity_of_power.enabled
+	if Talent(clarity_of_power_talent) ShadowCopCdActions()
+	#call_action_list,name=vent,if=talent.void_entropy.enabled
+	if Talent(void_entropy_talent) ShadowVentCdActions()
+	#call_action_list,name=main
+	ShadowMainCdActions()
+}
+
+### actions.main
+
+AddFunction ShadowMainMainActions
 {
-	#mindbender,if=talent.mindbender.enabled
-	if Talent(mindbender_talent) Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled
-	if not Talent(mindbender_talent) Spell(shadowfiend)
 	#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)
 	#mind_blast,if=glyph.mind_harvest.enabled&shadow_orb<=2&active_enemies<=5&cooldown_react
@@ -251,12 +363,6 @@ AddFunction ShadowMainActions
 	if BuffRemaining(shadow_word_insanity_buff) < 0.5 * GCD() and Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) Spell(insanity)
 	#insanity,chain=1,if=active_enemies<=2,interrupt_if=(cooldown.mind_blast.remains<=0.1|cooldown.shadow_word_death.remains<=0.1|shadow_orb=5)
 	if Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) 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)
-	#cascade,if=talent.cascade.enabled&active_enemies>2&target.distance<=40
-	if Talent(cascade_talent) and Enemies() > 2 and target.Distance() <= 40 Spell(cascade_caster)
-	#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)
 	#shadow_word_pain,if=talent.auspicious_spirits.enabled&remains<(18*0.3)&miss_react,cycle_targets=1
 	if Talent(auspicious_spirits_talent) and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.3 and True(miss_react) Spell(shadow_word_pain)
 	#shadow_word_pain,if=!talent.auspicious_spirits.enabled&remains<(18*0.3)&miss_react&active_enemies<=5,cycle_targets=1,max_cycle_targets=5
@@ -267,12 +373,6 @@ AddFunction ShadowMainActions
 	if not Talent(void_entropy_talent) and ShadowOrbs() >= 3 and target.TicksRemaining(devouring_plague_debuff) < 2 Spell(devouring_plague)
 	#mind_spike,if=active_enemies<=5&buff.surge_of_darkness.react=3
 	if Enemies() <= 5 and BuffStacks(surge_of_darkness_buff) == 3 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)
-	#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
-	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
 	{
@@ -281,8 +381,6 @@ AddFunction ShadowMainActions
 		{
 			#mind_spike,if=buff.surge_of_darkness.react&active_enemies<=5
 			if BuffPresent(surge_of_darkness_buff) and Enemies() <= 5 Spell(mind_spike)
-			#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)
 			#mind_sear,chain=1,if=active_enemies>=4,interrupt_if=(cooldown.mind_blast.remains<=0.1|cooldown.shadow_word_death.remains<=0.1|shadow_orb=5)
 			if Enemies() >= 4 Spell(mind_sear)
 			#shadow_word_pain,if=shadow_orb>=2&ticks_remain<=3&talent.insanity.enabled
@@ -293,10 +391,6 @@ AddFunction ShadowMainActions
 			Spell(mind_flay)
 			#mind_blast,moving=1,if=buff.shadowy_insight.react&cooldown_react
 			if Speed() > 0 and BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 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)
-			#cascade,moving=1,if=talent.cascade.enabled&target.distance<=40
-			if Speed() > 0 and Talent(cascade_talent) and target.Distance() <= 40 Spell(cascade_caster)
 			#shadow_word_death,moving=1
 			if Speed() > 0 Spell(shadow_word_death)
 			#shadow_word_pain,moving=1,cycle_targets=1
@@ -305,7 +399,61 @@ AddFunction ShadowMainActions
 	}
 }

-AddFunction ShadowPrecombatActions
+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)
+	{
+		#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)
+		#cascade,if=talent.cascade.enabled&active_enemies>2&target.distance<=40
+		if Talent(cascade_talent) and Enemies() > 2 and target.Distance() <= 40 Spell(cascade_caster)
+		#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)
+		{
+			#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)
+			#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
+			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
+			{
+				#wait,sec=cooldown.mind_blast.remains,if=cooldown.mind_blast.remains<0.5&cooldown.mind_blast.remains&active_enemies<=1
+				unless SpellCooldown(mind_blast) < 0.5 and SpellCooldown(mind_blast) > 0 and Enemies() <= 1 and SpellCooldown(mind_blast) > 0
+				{
+					unless BuffPresent(surge_of_darkness_buff) and Enemies() <= 5 and Spell(mind_spike)
+					{
+						#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)
+						{
+							#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)
+							#cascade,moving=1,if=talent.cascade.enabled&target.distance<=40
+							if Speed() > 0 and Talent(cascade_talent) and target.Distance() <= 40 Spell(cascade_caster)
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+AddFunction ShadowMainCdActions
+{
+	#mindbender,if=talent.mindbender.enabled
+	if Talent(mindbender_talent) Spell(mindbender)
+	#shadowfiend,if=!talent.mindbender.enabled
+	if not Talent(mindbender_talent) Spell(shadowfiend)
+}
+
+### actions.precombat
+
+AddFunction ShadowPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=sleeper_surprise
@@ -313,29 +461,52 @@ 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
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#mind_spike
 	Spell(mind_spike)
 }

-AddFunction ShadowPvpDispersionActions
+AddFunction ShadowPrecombatCdActions
+{
+	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()
+	}
+}
+
+### actions.pvp_dispersion
+
+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
+	ShadowDecisionMainActions()
+}
+
+AddFunction ShadowPvpDispersionShortCdActions
+{
+	#call_action_list,name=decision,if=cooldown.dispersion.remains>0
+	if SpellCooldown(dispersion) > 0 ShadowDecisionShortCdActions()
+	#call_action_list,name=decision
+	ShadowDecisionShortCdActions()
+}
+
+AddFunction ShadowPvpDispersionCdActions
+{
+	#call_action_list,name=decision,if=cooldown.dispersion.remains>0
+	if SpellCooldown(dispersion) > 0 ShadowDecisionCdActions()
 	#dispersion,interrupt=1
 	Spell(dispersion)
 	#call_action_list,name=decision
-	ShadowDecisionActions()
+	ShadowDecisionCdActions()
 }

-AddFunction ShadowVentActions
+### actions.vent
+
+AddFunction ShadowVentMainActions
 {
-	#mindbender,if=talent.mindbender.enabled&cooldown.mind_blast.remains>=gcd
-	if Talent(mindbender_talent) and SpellCooldown(mind_blast) >= GCD() Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled&cooldown.mind_blast.remains>=gcd
-	if not Talent(mindbender_talent) and SpellCooldown(mind_blast) >= GCD() Spell(shadowfiend)
 	#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)
 	#void_entropy,if=!dot.void_entropy.ticking&shadow_orb=5&active_enemies>=1&target.time_to_die>60,cycle_targets=1,max_cycle_targets=(60%(cooldown.mind_blast.duration*3*spell_haste))
@@ -348,8 +519,6 @@ AddFunction ShadowVentActions
 	if ShadowOrbs() == 5 and target.DebuffRemaining(void_entropy_debuff) < 20 Spell(devouring_plague)
 	#devouring_plague,if=shadow_orb=5&dot.void_entropy.remains,cycle_targets=1
 	if ShadowOrbs() == 5 and target.DebuffRemaining(void_entropy_debuff) 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)
 	#mind_blast,if=glyph.mind_harvest.enabled&mind_harvest=0&shadow_orb<=2,cycle_targets=1
 	if Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() <= 2 Spell(mind_blast)
 	#devouring_plague,if=glyph.mind_harvest.enabled&mind_harvest=0&shadow_orb>=3,cycle_targets=1
@@ -370,12 +539,6 @@ AddFunction ShadowVentActions
 	if 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) Spell(shadow_word_pain)
 	#vampiric_touch,if=remains<(15*0.35)&miss_react,cycle_targets=1,max_cycle_targets=5
 	if DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and target.DebuffRemaining(vampiric_touch_debuff) < 15 * 0.35 and True(miss_react) 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)
-	#cascade,if=talent.cascade.enabled&target.distance<=40&cooldown.mind_blast.remains>0.5*gcd
-	if Talent(cascade_talent) and target.Distance() <= 40 and SpellCooldown(mind_blast) > 0.5 * GCD() Spell(cascade_caster)
-	#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)
 	#mind_spike,if=active_enemies<=5&buff.surge_of_darkness.up&cooldown_react&cooldown.mind_blast.remains>0.5*gcd
 	if Enemies() <= 5 and BuffPresent(surge_of_darkness_buff) and not SpellCooldown(mind_spike) > 0 and SpellCooldown(mind_blast) > 0.5 * GCD() Spell(mind_spike)
 	#mind_sear,chain=1,if=active_enemies>=3&cooldown.mind_blast.remains>0.5*gcd,interrupt_if=(cooldown.mind_blast.remains<=0.1|cooldown.shadow_word_death.remains<=0.1)
@@ -386,26 +549,82 @@ AddFunction ShadowVentActions
 	if Speed() > 0 Spell(shadow_word_death)
 	#mind_blast,moving=1,if=buff.shadowy_insight.react&cooldown_react
 	if Speed() > 0 and BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 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)
-	#cascade,moving=1,if=talent.cascade.enabled&target.distance<=40
-	if Speed() > 0 and Talent(cascade_talent) and target.Distance() <= 40 Spell(cascade_caster)
 	#shadow_word_death,moving=1
 	if Speed() > 0 Spell(shadow_word_death)
 	#shadow_word_pain,moving=1,cycle_targets=1
 	if Speed() > 0 Spell(shadow_word_pain)
 }

+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)
+	{
+		#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)
+		{
+			#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)
+			#cascade,if=talent.cascade.enabled&target.distance<=40&cooldown.mind_blast.remains>0.5*gcd
+			if Talent(cascade_talent) and target.Distance() <= 40 and SpellCooldown(mind_blast) > 0.5 * GCD() Spell(cascade_caster)
+			#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)
+			{
+				#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)
+				#cascade,moving=1,if=talent.cascade.enabled&target.distance<=40
+				if Speed() > 0 and Talent(cascade_talent) and target.Distance() <= 40 Spell(cascade_caster)
+			}
+		}
+	}
+}
+
+AddFunction ShadowVentCdActions
+{
+	#mindbender,if=talent.mindbender.enabled&cooldown.mind_blast.remains>=gcd
+	if Talent(mindbender_talent) and SpellCooldown(mind_blast) >= GCD() Spell(mindbender)
+	#shadowfiend,if=!talent.mindbender.enabled&cooldown.mind_blast.remains>=gcd
+	if not Talent(mindbender_talent) and SpellCooldown(mind_blast) >= GCD() Spell(shadowfiend)
+}
+
+### Shadow icons.
+AddCheckBox(opt_priest_shadow_aoe L(AOE) specialization=shadow default)
+
+AddIcon specialization=shadow help=shortcd enemies=1 checkbox=!opt_priest_shadow_aoe
+{
+	ShadowDefaultShortCdActions()
+}
+
+AddIcon specialization=shadow help=shortcd checkbox=opt_priest_shadow_aoe
+{
+	ShadowDefaultShortCdActions()
+}
+
 AddIcon specialization=shadow help=main enemies=1
 {
-	if not InCombat() ShadowPrecombatActions()
-	ShadowDefaultActions()
+	if not InCombat() ShadowPrecombatMainActions()
+	ShadowDefaultMainActions()
+}
+
+AddIcon specialization=shadow help=aoe checkbox=opt_priest_shadow_aoe
+{
+	if not InCombat() ShadowPrecombatMainActions()
+	ShadowDefaultMainActions()
+}
+
+AddIcon specialization=shadow help=cd enemies=1 checkbox=!opt_priest_shadow_aoe
+{
+	if not InCombat() ShadowPrecombatCdActions()
+	ShadowDefaultCdActions()
 }

-AddIcon specialization=shadow help=aoe
+AddIcon specialization=shadow help=cd checkbox=opt_priest_shadow_aoe
 {
-	if not InCombat() ShadowPrecombatActions()
-	ShadowDefaultActions()
+	if not InCombat() ShadowPrecombatCdActions()
+	ShadowDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_priest_shadow_ve.lua b/scripts/simulationcraft_priest_shadow_ve.lua
index a68c56f..62e9c9f 100644
--- a/scripts/simulationcraft_priest_shadow_ve.lua
+++ b/scripts/simulationcraft_priest_shadow_ve.lua
@@ -35,27 +35,53 @@ AddFunction InterruptActions
 	}
 }

-AddFunction ShadowDefaultActions
+### actions.default
+
+AddFunction ShadowDefaultMainActions
 {
 	#shadowform,if=!buff.shadowform.up
 	if not BuffPresent(shadowform_buff) Spell(shadowform)
-	#potion,name=draenic_intellect,if=buff.bloodlust.react|target.time_to_die<=40
-	if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() <= 40 UsePotionIntellect()
-	#power_infusion,if=talent.power_infusion.enabled
-	if Talent(power_infusion_talent) Spell(power_infusion)
-	#blood_fury
-	Spell(blood_fury_sp)
-	#berserking
-	Spell(berserking)
-	#arcane_torrent
-	Spell(arcane_torrent_mana)
 	#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
+{
+	unless not BuffPresent(shadowform_buff) and Spell(shadowform)
+	{
+		#call_action_list,name=pvp_dispersion,if=set_bonus.pvp_2pc
+		if ArmorSetBonus(PVP 2) ShadowPvpDispersionShortCdActions()
+		#call_action_list,name=decision
+		ShadowDecisionShortCdActions()
+	}
 }

-AddFunction ShadowCopActions
+AddFunction ShadowDefaultCdActions
+{
+	unless not BuffPresent(shadowform_buff) and Spell(shadowform)
+	{
+		#potion,name=draenic_intellect,if=buff.bloodlust.react|target.time_to_die<=40
+		if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() <= 40 UsePotionIntellect()
+		#power_infusion,if=talent.power_infusion.enabled
+		if Talent(power_infusion_talent) Spell(power_infusion)
+		#blood_fury
+		Spell(blood_fury_sp)
+		#berserking
+		Spell(berserking)
+		#arcane_torrent
+		Spell(arcane_torrent_mana)
+		#call_action_list,name=pvp_dispersion,if=set_bonus.pvp_2pc
+		if ArmorSetBonus(PVP 2) ShadowPvpDispersionCdActions()
+		#call_action_list,name=decision
+		ShadowDecisionCdActions()
+	}
+}
+
+### actions.cop
+
+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)
@@ -67,16 +93,6 @@ AddFunction ShadowCopActions
 	if Enemies() <= 5 and not SpellCooldown(mind_blast) > 0 Spell(mind_blast)
 	#shadow_word_death,if=target.health.pct<20,cycle_targets=1
 	if target.HealthPercent() < 20 Spell(shadow_word_death)
-	#mindbender,if=talent.mindbender.enabled
-	if Talent(mindbender_talent) Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled
-	if not Talent(mindbender_talent) Spell(shadowfiend)
-	#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)
-	#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
-	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)
 	#shadow_word_pain,if=miss_react&!ticking&active_enemies<=5&primary_target=0,cycle_targets=1,max_cycle_targets=5
 	if 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 Spell(shadow_word_pain)
 	#vampiric_touch,if=remains<cast_time&miss_react&active_enemies<=5&primary_target=0,cycle_targets=1,max_cycle_targets=5
@@ -95,17 +111,47 @@ AddFunction ShadowCopActions
 	if Speed() > 0 Spell(shadow_word_death)
 	#mind_blast,if=buff.shadowy_insight.react&cooldown_react,moving=1
 	if BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Speed() > 0 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)
-	#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
-	if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
-	#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
-	if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
 	#shadow_word_pain,if=primary_target=0,moving=1,cycle_targets=1
 	if Speed() > 0 and 0 == 0 Spell(shadow_word_pain)
 }

-AddFunction ShadowCopDotweaveActions
+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)
+	{
+		#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)
+		#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
+		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)
+
+		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)
+			#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
+			if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
+			#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
+			if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
+		}
+	}
+}
+
+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)
+	{
+		#mindbender,if=talent.mindbender.enabled
+		if Talent(mindbender_talent) Spell(mindbender)
+		#shadowfiend,if=!talent.mindbender.enabled
+		if not Talent(mindbender_talent) Spell(shadowfiend)
+	}
+}
+
+### actions.cop_dotweave
+
+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)
@@ -117,10 +163,6 @@ AddFunction ShadowCopDotweaveActions
 	if Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() <= 2 Spell(mind_blast)
 	#mind_blast,if=shadow_orb<=4&cooldown_react
 	if ShadowOrbs() <= 4 and not SpellCooldown(mind_blast) > 0 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)
-	#mindbender,if=talent.mindbender.enabled&!buff.shadow_word_insanity.remains
-	if Talent(mindbender_talent) and not BuffPresent(shadow_word_insanity_buff) Spell(mindbender)
 	#shadow_word_pain,if=shadow_orb=4&set_bonus.tier17_2pc&!target.dot.shadow_word_pain.ticking&!target.dot.devouring_plague.ticking&cooldown.mind_blast.remains<1.2*gcd&cooldown.mind_blast.remains>0.2*gcd
 	if 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() Spell(shadow_word_pain)
 	#shadow_word_pain,if=shadow_orb=5&!target.dot.devouring_plague.ticking&!target.dot.shadow_word_pain.ticking
@@ -133,12 +175,6 @@ AddFunction ShadowCopDotweaveActions
 	if 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) Spell(shadow_word_pain)
 	#vampiric_touch,if=shadow_orb>=2&target.dot.vampiric_touch.remains>=5&cooldown.mind_blast.remains>0.5*gcd&buff.bloodlust.up&!set_bonus.tier17_2pc
 	if 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) 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)
-	#divine_star,if=cooldown.mind_blast.remains>0.5&gcd&talent.divine_star.enabled&(active_enemies>1|target.distance<=24)
-	if SpellCooldown(mind_blast) > 0.5 and GCD() and Talent(divine_star_talent) and { Enemies() > 1 or target.Distance() <= 24 } Spell(divine_star_caster)
-	#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)
 	#shadow_word_pain,if=primary_target=0&(!ticking|remains<=18*0.3),cycle_targets=1,max_cycle_targets=5
 	if 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 } Spell(shadow_word_pain)
 	#vampiric_touch,if=primary_target=0&(!ticking|remains<=15*0.3),cycle_targets=1,max_cycle_targets=5
@@ -153,17 +189,47 @@ AddFunction ShadowCopDotweaveActions
 	Spell(mind_spike)
 	#shadow_word_death,moving=1
 	if Speed() > 0 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)
-	#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
-	if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
-	#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
-	if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
 	#shadow_word_pain,moving=1
 	if Speed() > 0 Spell(shadow_word_pain)
 }

-AddFunction ShadowCopMfiActions
+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)
+	{
+		#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)
+		#divine_star,if=cooldown.mind_blast.remains>0.5&gcd&talent.divine_star.enabled&(active_enemies>1|target.distance<=24)
+		if SpellCooldown(mind_blast) > 0.5 and GCD() and Talent(divine_star_talent) and { Enemies() > 1 or target.Distance() <= 24 } Spell(divine_star_caster)
+		#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)
+		{
+			#halo,if=talent.halo.enabled&target.distance<=30,moving=1
+			if Talent(halo_talent) and target.Distance() <= 30 and Speed() > 0 Spell(halo_caster)
+			#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
+			if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
+			#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
+			if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
+		}
+	}
+}
+
+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)
+	{
+		#shadowfiend,if=!talent.mindbender.enabled&!buff.shadow_word_insanity.remains
+		if not Talent(mindbender_talent) and not BuffPresent(shadow_word_insanity_buff) Spell(shadowfiend)
+		#mindbender,if=talent.mindbender.enabled&!buff.shadow_word_insanity.remains
+		if Talent(mindbender_talent) and not BuffPresent(shadow_word_insanity_buff) Spell(mindbender)
+	}
+}
+
+### actions.cop_mfi
+
+AddFunction ShadowCopMfiMainActions
 {
 	#devouring_plague,if=shadow_orb=5
 	if ShadowOrbs() == 5 Spell(devouring_plague)
@@ -175,10 +241,6 @@ AddFunction ShadowCopMfiActions
 	if target.HealthPercent() < 20 Spell(shadow_word_death)
 	#devouring_plague,if=shadow_orb>=3&(cooldown.mind_blast.remains<gcd*1.0|target.health.pct<20&cooldown.shadow_word_death.remains<gcd*1.0)
 	if ShadowOrbs() >= 3 and { SpellCooldown(mind_blast) < GCD() * 1 or target.HealthPercent() < 20 and SpellCooldown(shadow_word_death) < GCD() * 1 } Spell(devouring_plague)
-	#mindbender,if=talent.mindbender.enabled
-	if Talent(mindbender_talent) Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled
-	if not Talent(mindbender_talent) Spell(shadowfiend)
 	#shadow_word_pain,if=remains<(18*0.3)&miss_react&active_enemies<=5&primary_target=0,cycle_targets=1,max_cycle_targets=5
 	if 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 Spell(shadow_word_pain)
 	#vampiric_touch,if=remains<(15*0.3+cast_time)&miss_react&active_enemies<=5&primary_target=0,cycle_targets=1,max_cycle_targets=5
@@ -187,12 +249,6 @@ AddFunction ShadowCopMfiActions
 	if BuffRemaining(shadow_word_insanity_buff) < 0.5 * GCD() and Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) Spell(insanity)
 	#insanity,if=active_enemies<=2,chain=1,interrupt_if=(cooldown.mind_blast.remains<=0.1|(cooldown.shadow_word_death.remains<=0.1*target.health.pct<20))
 	if Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) 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)
-	#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
-	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)
 	#mind_sear,if=active_enemies>=6,chain=1,interrupt_if=(cooldown.mind_blast.remains<=0.1|cooldown.shadow_word_death.remains<=0.1)
 	if Enemies() >= 6 Spell(mind_sear)
 	#mind_spike
@@ -201,36 +257,92 @@ AddFunction ShadowCopMfiActions
 	if Speed() > 0 Spell(shadow_word_death)
 	#mind_blast,if=buff.shadowy_insight.react&cooldown_react,moving=1
 	if BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 and Speed() > 0 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)
-	#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
-	if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
-	#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
-	if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
 	#shadow_word_pain,if=primary_target=0,moving=1,cycle_targets=1
 	if Speed() > 0 and 0 == 0 Spell(shadow_word_pain)
 }

-AddFunction ShadowDecisionActions
+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)
+	{
+		#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)
+		#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
+		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)
+
+		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)
+			#divine_star,if=talent.divine_star.enabled&target.distance<=28,moving=1
+			if Talent(divine_star_talent) and target.Distance() <= 28 and Speed() > 0 Spell(divine_star_caster)
+			#cascade,if=talent.cascade.enabled&target.distance<=40,moving=1
+			if Talent(cascade_talent) and target.Distance() <= 40 and Speed() > 0 Spell(cascade_caster)
+		}
+	}
+}
+
+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)
+	{
+		#mindbender,if=talent.mindbender.enabled
+		if Talent(mindbender_talent) Spell(mindbender)
+		#shadowfiend,if=!talent.mindbender.enabled
+		if not Talent(mindbender_talent) Spell(shadowfiend)
+	}
+}
+
+### actions.decision
+
+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 ShadowMainActions
+AddFunction ShadowDecisionShortCdActions
+{
+	#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 ShadowCopDotweaveShortCdActions()
+	#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 ShadowCopMfiShortCdActions()
+	#call_action_list,name=cop,if=talent.clarity_of_power.enabled
+	if Talent(clarity_of_power_talent) ShadowCopShortCdActions()
+	#call_action_list,name=vent,if=talent.void_entropy.enabled
+	if Talent(void_entropy_talent) ShadowVentShortCdActions()
+	#call_action_list,name=main
+	ShadowMainShortCdActions()
+}
+
+AddFunction ShadowDecisionCdActions
+{
+	#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 ShadowCopDotweaveCdActions()
+	#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 ShadowCopMfiCdActions()
+	#call_action_list,name=cop,if=talent.clarity_of_power.enabled
+	if Talent(clarity_of_power_talent) ShadowCopCdActions()
+	#call_action_list,name=vent,if=talent.void_entropy.enabled
+	if Talent(void_entropy_talent) ShadowVentCdActions()
+	#call_action_list,name=main
+	ShadowMainCdActions()
+}
+
+### actions.main
+
+AddFunction ShadowMainMainActions
 {
-	#mindbender,if=talent.mindbender.enabled
-	if Talent(mindbender_talent) Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled
-	if not Talent(mindbender_talent) Spell(shadowfiend)
 	#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)
 	#mind_blast,if=glyph.mind_harvest.enabled&shadow_orb<=2&active_enemies<=5&cooldown_react
@@ -251,12 +363,6 @@ AddFunction ShadowMainActions
 	if BuffRemaining(shadow_word_insanity_buff) < 0.5 * GCD() and Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) Spell(insanity)
 	#insanity,chain=1,if=active_enemies<=2,interrupt_if=(cooldown.mind_blast.remains<=0.1|cooldown.shadow_word_death.remains<=0.1|shadow_orb=5)
 	if Enemies() <= 2 and BuffPresent(shadow_word_insanity_buff) 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)
-	#cascade,if=talent.cascade.enabled&active_enemies>2&target.distance<=40
-	if Talent(cascade_talent) and Enemies() > 2 and target.Distance() <= 40 Spell(cascade_caster)
-	#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)
 	#shadow_word_pain,if=talent.auspicious_spirits.enabled&remains<(18*0.3)&miss_react,cycle_targets=1
 	if Talent(auspicious_spirits_talent) and target.DebuffRemaining(shadow_word_pain_debuff) < 18 * 0.3 and True(miss_react) Spell(shadow_word_pain)
 	#shadow_word_pain,if=!talent.auspicious_spirits.enabled&remains<(18*0.3)&miss_react&active_enemies<=5,cycle_targets=1,max_cycle_targets=5
@@ -267,12 +373,6 @@ AddFunction ShadowMainActions
 	if not Talent(void_entropy_talent) and ShadowOrbs() >= 3 and target.TicksRemaining(devouring_plague_debuff) < 2 Spell(devouring_plague)
 	#mind_spike,if=active_enemies<=5&buff.surge_of_darkness.react=3
 	if Enemies() <= 5 and BuffStacks(surge_of_darkness_buff) == 3 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)
-	#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
-	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
 	{
@@ -281,8 +381,6 @@ AddFunction ShadowMainActions
 		{
 			#mind_spike,if=buff.surge_of_darkness.react&active_enemies<=5
 			if BuffPresent(surge_of_darkness_buff) and Enemies() <= 5 Spell(mind_spike)
-			#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)
 			#mind_sear,chain=1,if=active_enemies>=4,interrupt_if=(cooldown.mind_blast.remains<=0.1|cooldown.shadow_word_death.remains<=0.1|shadow_orb=5)
 			if Enemies() >= 4 Spell(mind_sear)
 			#shadow_word_pain,if=shadow_orb>=2&ticks_remain<=3&talent.insanity.enabled
@@ -293,10 +391,6 @@ AddFunction ShadowMainActions
 			Spell(mind_flay)
 			#mind_blast,moving=1,if=buff.shadowy_insight.react&cooldown_react
 			if Speed() > 0 and BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 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)
-			#cascade,moving=1,if=talent.cascade.enabled&target.distance<=40
-			if Speed() > 0 and Talent(cascade_talent) and target.Distance() <= 40 Spell(cascade_caster)
 			#shadow_word_death,moving=1
 			if Speed() > 0 Spell(shadow_word_death)
 			#shadow_word_pain,moving=1,cycle_targets=1
@@ -305,7 +399,61 @@ AddFunction ShadowMainActions
 	}
 }

-AddFunction ShadowPrecombatActions
+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)
+	{
+		#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)
+		#cascade,if=talent.cascade.enabled&active_enemies>2&target.distance<=40
+		if Talent(cascade_talent) and Enemies() > 2 and target.Distance() <= 40 Spell(cascade_caster)
+		#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)
+		{
+			#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)
+			#cascade,if=talent.cascade.enabled&((active_enemies>1|target.distance>=28)&target.distance<=40&target.distance>=11)
+			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
+			{
+				#wait,sec=cooldown.mind_blast.remains,if=cooldown.mind_blast.remains<0.5&cooldown.mind_blast.remains&active_enemies<=1
+				unless SpellCooldown(mind_blast) < 0.5 and SpellCooldown(mind_blast) > 0 and Enemies() <= 1 and SpellCooldown(mind_blast) > 0
+				{
+					unless BuffPresent(surge_of_darkness_buff) and Enemies() <= 5 and Spell(mind_spike)
+					{
+						#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)
+						{
+							#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)
+							#cascade,moving=1,if=talent.cascade.enabled&target.distance<=40
+							if Speed() > 0 and Talent(cascade_talent) and target.Distance() <= 40 Spell(cascade_caster)
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+AddFunction ShadowMainCdActions
+{
+	#mindbender,if=talent.mindbender.enabled
+	if Talent(mindbender_talent) Spell(mindbender)
+	#shadowfiend,if=!talent.mindbender.enabled
+	if not Talent(mindbender_talent) Spell(shadowfiend)
+}
+
+### actions.precombat
+
+AddFunction ShadowPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=frosty_stew
@@ -313,29 +461,52 @@ 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
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#vampiric_touch
 	Spell(vampiric_touch)
 }

-AddFunction ShadowPvpDispersionActions
+AddFunction ShadowPrecombatCdActions
+{
+	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()
+	}
+}
+
+### actions.pvp_dispersion
+
+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
+	ShadowDecisionMainActions()
+}
+
+AddFunction ShadowPvpDispersionShortCdActions
+{
+	#call_action_list,name=decision,if=cooldown.dispersion.remains>0
+	if SpellCooldown(dispersion) > 0 ShadowDecisionShortCdActions()
+	#call_action_list,name=decision
+	ShadowDecisionShortCdActions()
+}
+
+AddFunction ShadowPvpDispersionCdActions
+{
+	#call_action_list,name=decision,if=cooldown.dispersion.remains>0
+	if SpellCooldown(dispersion) > 0 ShadowDecisionCdActions()
 	#dispersion,interrupt=1
 	Spell(dispersion)
 	#call_action_list,name=decision
-	ShadowDecisionActions()
+	ShadowDecisionCdActions()
 }

-AddFunction ShadowVentActions
+### actions.vent
+
+AddFunction ShadowVentMainActions
 {
-	#mindbender,if=talent.mindbender.enabled&cooldown.mind_blast.remains>=gcd
-	if Talent(mindbender_talent) and SpellCooldown(mind_blast) >= GCD() Spell(mindbender)
-	#shadowfiend,if=!talent.mindbender.enabled&cooldown.mind_blast.remains>=gcd
-	if not Talent(mindbender_talent) and SpellCooldown(mind_blast) >= GCD() Spell(shadowfiend)
 	#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)
 	#void_entropy,if=!dot.void_entropy.ticking&shadow_orb=5&active_enemies>=1&target.time_to_die>60,cycle_targets=1,max_cycle_targets=(60%(cooldown.mind_blast.duration*3*spell_haste))
@@ -348,8 +519,6 @@ AddFunction ShadowVentActions
 	if ShadowOrbs() == 5 and target.DebuffRemaining(void_entropy_debuff) < 20 Spell(devouring_plague)
 	#devouring_plague,if=shadow_orb=5&dot.void_entropy.remains,cycle_targets=1
 	if ShadowOrbs() == 5 and target.DebuffRemaining(void_entropy_debuff) 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)
 	#mind_blast,if=glyph.mind_harvest.enabled&mind_harvest=0&shadow_orb<=2,cycle_targets=1
 	if Glyph(glyph_of_mind_harvest) and 0 == 0 and ShadowOrbs() <= 2 Spell(mind_blast)
 	#devouring_plague,if=glyph.mind_harvest.enabled&mind_harvest=0&shadow_orb>=3,cycle_targets=1
@@ -370,12 +539,6 @@ AddFunction ShadowVentActions
 	if 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) Spell(shadow_word_pain)
 	#vampiric_touch,if=remains<(15*0.35)&miss_react,cycle_targets=1,max_cycle_targets=5
 	if DebuffCountOnAny(vampiric_touch_debuff) <= Enemies() and DebuffCountOnAny(vampiric_touch_debuff) <= 5 and target.DebuffRemaining(vampiric_touch_debuff) < 15 * 0.35 and True(miss_react) 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)
-	#cascade,if=talent.cascade.enabled&target.distance<=40&cooldown.mind_blast.remains>0.5*gcd
-	if Talent(cascade_talent) and target.Distance() <= 40 and SpellCooldown(mind_blast) > 0.5 * GCD() Spell(cascade_caster)
-	#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)
 	#mind_spike,if=active_enemies<=5&buff.surge_of_darkness.up&cooldown_react&cooldown.mind_blast.remains>0.5*gcd
 	if Enemies() <= 5 and BuffPresent(surge_of_darkness_buff) and not SpellCooldown(mind_spike) > 0 and SpellCooldown(mind_blast) > 0.5 * GCD() Spell(mind_spike)
 	#mind_sear,chain=1,if=active_enemies>=3&cooldown.mind_blast.remains>0.5*gcd,interrupt_if=(cooldown.mind_blast.remains<=0.1|cooldown.shadow_word_death.remains<=0.1)
@@ -386,26 +549,82 @@ AddFunction ShadowVentActions
 	if Speed() > 0 Spell(shadow_word_death)
 	#mind_blast,moving=1,if=buff.shadowy_insight.react&cooldown_react
 	if Speed() > 0 and BuffPresent(shadowy_insight_buff) and not SpellCooldown(mind_blast) > 0 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)
-	#cascade,moving=1,if=talent.cascade.enabled&target.distance<=40
-	if Speed() > 0 and Talent(cascade_talent) and target.Distance() <= 40 Spell(cascade_caster)
 	#shadow_word_death,moving=1
 	if Speed() > 0 Spell(shadow_word_death)
 	#shadow_word_pain,moving=1,cycle_targets=1
 	if Speed() > 0 Spell(shadow_word_pain)
 }

+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)
+	{
+		#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)
+		{
+			#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)
+			#cascade,if=talent.cascade.enabled&target.distance<=40&cooldown.mind_blast.remains>0.5*gcd
+			if Talent(cascade_talent) and target.Distance() <= 40 and SpellCooldown(mind_blast) > 0.5 * GCD() Spell(cascade_caster)
+			#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)
+			{
+				#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)
+				#cascade,moving=1,if=talent.cascade.enabled&target.distance<=40
+				if Speed() > 0 and Talent(cascade_talent) and target.Distance() <= 40 Spell(cascade_caster)
+			}
+		}
+	}
+}
+
+AddFunction ShadowVentCdActions
+{
+	#mindbender,if=talent.mindbender.enabled&cooldown.mind_blast.remains>=gcd
+	if Talent(mindbender_talent) and SpellCooldown(mind_blast) >= GCD() Spell(mindbender)
+	#shadowfiend,if=!talent.mindbender.enabled&cooldown.mind_blast.remains>=gcd
+	if not Talent(mindbender_talent) and SpellCooldown(mind_blast) >= GCD() Spell(shadowfiend)
+}
+
+### Shadow icons.
+AddCheckBox(opt_priest_shadow_aoe L(AOE) specialization=shadow default)
+
+AddIcon specialization=shadow help=shortcd enemies=1 checkbox=!opt_priest_shadow_aoe
+{
+	ShadowDefaultShortCdActions()
+}
+
+AddIcon specialization=shadow help=shortcd checkbox=opt_priest_shadow_aoe
+{
+	ShadowDefaultShortCdActions()
+}
+
 AddIcon specialization=shadow help=main enemies=1
 {
-	if not InCombat() ShadowPrecombatActions()
-	ShadowDefaultActions()
+	if not InCombat() ShadowPrecombatMainActions()
+	ShadowDefaultMainActions()
+}
+
+AddIcon specialization=shadow help=aoe checkbox=opt_priest_shadow_aoe
+{
+	if not InCombat() ShadowPrecombatMainActions()
+	ShadowDefaultMainActions()
+}
+
+AddIcon specialization=shadow help=cd enemies=1 checkbox=!opt_priest_shadow_aoe
+{
+	if not InCombat() ShadowPrecombatCdActions()
+	ShadowDefaultCdActions()
 }

-AddIcon specialization=shadow help=aoe
+AddIcon specialization=shadow help=cd checkbox=opt_priest_shadow_aoe
 {
-	if not InCombat() ShadowPrecombatActions()
-	ShadowDefaultActions()
+	if not InCombat() ShadowPrecombatCdActions()
+	ShadowDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_rogue_assassination.lua b/scripts/simulationcraft_rogue_assassination.lua
index 17a15fc..52ad958 100644
--- a/scripts/simulationcraft_rogue_assassination.lua
+++ b/scripts/simulationcraft_rogue_assassination.lua
@@ -53,24 +53,10 @@ AddFunction InterruptActions
 	}
 }

-AddFunction AssassinationDefaultActions
+### actions.default
+
+AddFunction AssassinationDefaultMainActions
 {
-	#potion,name=draenic_agility,if=buff.bloodlust.react|target.time_to_die<40|debuff.vendetta.up
-	if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() < 40 or target.DebuffPresent(vendetta_debuff) UsePotionAgility()
-	#kick
-	InterruptActions()
-	#preparation,if=!buff.vanish.up&cooldown.vanish.remains>30
-	if not BuffPresent(vanish_buff) 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
-	Spell(blood_fury_ap)
-	#berserking
-	Spell(berserking)
-	#arcane_torrent,if=energy<60
-	if Energy() < 60 Spell(arcane_torrent_energy)
-	#vanish,if=time>10&!buff.stealth.up
-	if TimeInCombat() > 10 and not BuffPresent(stealthed_buff any=1) Spell(vanish)
 	#rupture,if=combo_points=5&ticks_remain<3
 	if ComboPoints() == 5 and target.TicksRemaining(rupture_debuff) < 3 Spell(rupture)
 	#rupture,cycle_targets=1,if=active_enemies>1&!ticking&combo_points=5
@@ -79,18 +65,12 @@ AddFunction AssassinationDefaultActions
 	if BuffPresent(stealthed_buff any=1) Spell(mutilate)
 	#slice_and_dice,if=buff.slice_and_dice.remains<5
 	if BuffRemaining(slice_and_dice_buff) < 5 Spell(slice_and_dice)
-	#marked_for_death,if=combo_points=0
-	if ComboPoints() == 0 Spell(marked_for_death)
 	#crimson_tempest,if=combo_points>4&active_enemies>=4&remains<8
 	if ComboPoints() > 4 and Enemies() >= 4 and target.DebuffRemaining(crimson_tempest_debuff) < 8 Spell(crimson_tempest)
 	#fan_of_knives,if=combo_points<5&active_enemies>=4
 	if ComboPoints() < 5 and Enemies() >= 4 Spell(fan_of_knives)
 	#rupture,if=(remains<2|(combo_points=5&remains<=(duration*0.3)))&active_enemies=1
 	if { target.DebuffRemaining(rupture_debuff) < 2 or ComboPoints() == 5 and target.DebuffRemaining(rupture_debuff) <= BaseDuration(rupture_debuff) * 0.3 } and Enemies() == 1 Spell(rupture)
-	#shadow_reflection,if=cooldown.vendetta.remains=0
-	if not SpellCooldown(vendetta) > 0 Spell(shadow_reflection)
-	#vendetta,if=buff.shadow_reflection.up|!talent.shadow_reflection.enabled
-	if BuffPresent(shadow_reflection_buff) or not Talent(shadow_reflection_talent) Spell(vendetta)
 	#envenom,cycle_targets=1,if=(combo_points>4&buff.envenom.remains<2&(cooldown.death_from_above.remains>2|!talent.death_from_above.enabled))&active_enemies<4&!dot.deadly_poison_dot.ticking
 	if ComboPoints() > 4 and BuffRemaining(envenom_buff) < 2 and { SpellCooldown(death_from_above) > 2 or not Talent(death_from_above_talent) } and Enemies() < 4 and not target.DebuffPresent(deadly_poison_dot_debuff) Spell(envenom)
 	#envenom,if=(combo_points>4&buff.envenom.remains<2&(cooldown.death_from_above.remains>2|!talent.death_from_above.enabled))&active_enemies<4
@@ -111,33 +91,114 @@ AddFunction AssassinationDefaultActions
 	if Enemies() < 5 Spell(mutilate)
 }

-AddFunction AssassinationPrecombatActions
+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)
+	{
+		#marked_for_death,if=combo_points=0
+		if ComboPoints() == 0 Spell(marked_for_death)
+	}
+}
+
+AddFunction AssassinationDefaultCdActions
+{
+	#potion,name=draenic_agility,if=buff.bloodlust.react|target.time_to_die<40|debuff.vendetta.up
+	if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() < 40 or target.DebuffPresent(vendetta_debuff) UsePotionAgility()
+	#kick
+	InterruptActions()
+	#preparation,if=!buff.vanish.up&cooldown.vanish.remains>30
+	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
+	Spell(blood_fury_ap)
+	#berserking
+	Spell(berserking)
+	#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) 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)
+		#vendetta,if=buff.shadow_reflection.up|!talent.shadow_reflection.enabled
+		if BuffPresent(shadow_reflection_buff) or not Talent(shadow_reflection_talent) Spell(vendetta)
+	}
+}
+
+### actions.precombat
+
+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=draenic_agility
-	UsePotionAgility()
 	#stealth
 	if BuffExpires(stealthed_buff any=1) Spell(stealth)
-	#marked_for_death
-	Spell(marked_for_death)
 	#slice_and_dice,if=talent.marked_for_death.enabled
 	if Talent(marked_for_death_talent) Spell(slice_and_dice)
 }

+AddFunction AssassinationPrecombatShortCdActions
+{
+	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)
+	}
+}
+
+AddFunction AssassinationPrecombatCdActions
+{
+	unless BuffRemaining(lethal_poison_buff) < 1200 and Spell(deadly_poison)
+	{
+		#snapshot_stats
+		#potion,name=draenic_agility
+		UsePotionAgility()
+	}
+}
+
+### Assassination icons.
+AddCheckBox(opt_rogue_assassination_aoe L(AOE) specialization=assassination default)
+
+AddIcon specialization=assassination help=shortcd enemies=1 checkbox=!opt_rogue_assassination_aoe
+{
+	if not InCombat() AssassinationPrecombatShortCdActions()
+	AssassinationDefaultShortCdActions()
+}
+
+AddIcon specialization=assassination help=shortcd checkbox=opt_rogue_assassination_aoe
+{
+	if not InCombat() AssassinationPrecombatShortCdActions()
+	AssassinationDefaultShortCdActions()
+}
+
 AddIcon specialization=assassination help=main enemies=1
 {
-	if not InCombat() AssassinationPrecombatActions()
-	AssassinationDefaultActions()
+	if not InCombat() AssassinationPrecombatMainActions()
+	AssassinationDefaultMainActions()
+}
+
+AddIcon specialization=assassination help=aoe checkbox=opt_rogue_assassination_aoe
+{
+	if not InCombat() AssassinationPrecombatMainActions()
+	AssassinationDefaultMainActions()
+}
+
+AddIcon specialization=assassination help=cd enemies=1 checkbox=!opt_rogue_assassination_aoe
+{
+	if not InCombat() AssassinationPrecombatCdActions()
+	AssassinationDefaultCdActions()
 }

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

 ### Required symbols
@@ -161,7 +222,6 @@ AddIcon specialization=assassination help=aoe
 # fan_of_knives
 # kick
 # kidney_shot
-# lethal_poison_buff
 # marked_for_death
 # marked_for_death_talent
 # mutilate
@@ -177,7 +237,6 @@ AddIcon specialization=assassination help=aoe
 # slice_and_dice_buff
 # stealth
 # vanish
-# vanish_buff
 # vendetta
 # vendetta_debuff
 ]]
diff --git a/scripts/simulationcraft_rogue_combat.lua b/scripts/simulationcraft_rogue_combat.lua
index 7804583..b3af417 100644
--- a/scripts/simulationcraft_rogue_combat.lua
+++ b/scripts/simulationcraft_rogue_combat.lua
@@ -54,14 +54,46 @@ AddFunction InterruptActions
 	}
 }

-AddFunction CombatDefaultActions
+### actions.default
+
+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) 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 } CombatFinisherMainActions()
+}
+
+AddFunction CombatDefaultShortCdActions
+{
+	#blade_flurry,if=(active_enemies>=2&!buff.blade_flurry.up)|(active_enemies<2&buff.blade_flurry.up)
+	if { Enemies() >= 2 and not BuffPresent(blade_flurry_buff) or Enemies() < 2 and BuffPresent(blade_flurry_buff) } and CheckBoxOn(opt_blade_flurry) Spell(blade_flurry)
+
+	unless Spell(ambush)
+	{
+		#vanish,if=time>10&(combo_points<3|(talent.anticipation.enabled&anticipation_charges<3)|(combo_points<4|(talent.anticipation.enabled&anticipation_charges<4)))&((talent.shadow_focus.enabled&buff.adrenaline_rush.down&energy<90&energy>=15)|(talent.subterfuge.enabled&energy>=90)|(!talent.shadow_focus.enabled&!talent.subterfuge.enabled&energy>=60))
+		if TimeInCombat() > 10 and { ComboPoints() < 3 or Talent(anticipation_talent) and BuffStacks(anticipation_buff) < 3 or ComboPoints() < 4 or Talent(anticipation_talent) and BuffStacks(anticipation_buff) < 4 } and { Talent(shadow_focus_talent) and BuffExpires(adrenaline_rush_buff) and Energy() < 90 and Energy() >= 15 or Talent(subterfuge_talent) and Energy() >= 90 or not Talent(shadow_focus_talent) and not Talent(subterfuge_talent) and Energy() >= 60 } Spell(vanish)
+
+		unless { 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)
+		{
+			#marked_for_death,if=combo_points<=1&dot.revealing_strike.ticking&(!talent.shadow_reflection.enabled|buff.shadow_reflection.up|cooldown.shadow_reflection.remains>30)
+			if ComboPoints() <= 1 and target.DebuffPresent(revealing_strike_debuff) and { not Talent(shadow_reflection_talent) or BuffPresent(shadow_reflection_buff) or SpellCooldown(shadow_reflection) > 30 } Spell(marked_for_death)
+		}
+	}
+}
+
+AddFunction CombatDefaultCdActions
 {
 	#potion,name=draenic_agility,if=buff.bloodlust.react|target.time_to_die<40|(buff.adrenaline_rush.up&(trinket.proc.any.react|trinket.stacking_proc.any.react|buff.archmages_greater_incandescence_agi.react))
 	if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() < 40 or BuffPresent(adrenaline_rush_buff) and { BuffPresent(trinket_proc_any_buff) or BuffPresent(trinket_stacking_proc_any_buff) or BuffPresent(archmages_greater_incandescence_agi_buff) } UsePotionAgility()
 	#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
@@ -70,29 +102,21 @@ AddFunction CombatDefaultActions
 	Spell(berserking)
 	#arcane_torrent,if=energy<60
 	if Energy() < 60 Spell(arcane_torrent_energy)
-	#blade_flurry,if=(active_enemies>=2&!buff.blade_flurry.up)|(active_enemies<2&buff.blade_flurry.up)
-	if { Enemies() >= 2 and not BuffPresent(blade_flurry_buff) or Enemies() < 2 and BuffPresent(blade_flurry_buff) } and CheckBoxOn(opt_blade_flurry) Spell(blade_flurry)
 	#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)
-	#ambush
-	Spell(ambush)
-	#vanish,if=time>10&(combo_points<3|(talent.anticipation.enabled&anticipation_charges<3)|(combo_points<4|(talent.anticipation.enabled&anticipation_charges<4)))&((talent.shadow_focus.enabled&buff.adrenaline_rush.down&energy<90&energy>=15)|(talent.subterfuge.enabled&energy>=90)|(!talent.shadow_focus.enabled&!talent.subterfuge.enabled&energy>=60))
-	if TimeInCombat() > 10 and { ComboPoints() < 3 or Talent(anticipation_talent) and BuffStacks(anticipation_buff) < 3 or ComboPoints() < 4 or Talent(anticipation_talent) and BuffStacks(anticipation_buff) < 4 } and { Talent(shadow_focus_talent) and BuffExpires(adrenaline_rush_buff) and Energy() < 90 and Energy() >= 15 or Talent(subterfuge_talent) and Energy() >= 90 or not Talent(shadow_focus_talent) and not Talent(subterfuge_talent) and Energy() >= 60 } Spell(vanish)
-	#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=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 CombatAdrenalineRushActions()
-	#call_action_list,name=killing_spree,if=(energy<40|(buff.bloodlust.up&time<10)|buff.bloodlust.remains>20)&buff.adrenaline_rush.down&(!talent.shadow_reflection.enabled|cooldown.shadow_reflection.remains>30|buff.shadow_reflection.remains>3)
-	if { Energy() < 40 or BuffPresent(burst_haste_buff any=1) and TimeInCombat() < 10 or BuffRemaining(burst_haste_buff any=1) > 20 } and BuffExpires(adrenaline_rush_buff) and { not Talent(shadow_reflection_talent) or SpellCooldown(shadow_reflection) > 30 or BuffRemaining(shadow_reflection_buff) > 3 } CombatKillingSpreeActions()
-	#marked_for_death,if=combo_points<=1&dot.revealing_strike.ticking&(!talent.shadow_reflection.enabled|buff.shadow_reflection.up|cooldown.shadow_reflection.remains>30)
-	if ComboPoints() <= 1 and target.DebuffPresent(revealing_strike_debuff) and { not Talent(shadow_reflection_talent) or BuffPresent(shadow_reflection_buff) or SpellCooldown(shadow_reflection) > 30 } Spell(marked_for_death)
-	#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()
-	#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()
+
+	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()
+		#call_action_list,name=killing_spree,if=(energy<40|(buff.bloodlust.up&time<10)|buff.bloodlust.remains>20)&buff.adrenaline_rush.down&(!talent.shadow_reflection.enabled|cooldown.shadow_reflection.remains>30|buff.shadow_reflection.remains>3)
+		if { Energy() < 40 or BuffPresent(burst_haste_buff any=1) and TimeInCombat() < 10 or BuffRemaining(burst_haste_buff any=1) > 20 } and BuffExpires(adrenaline_rush_buff) and { not Talent(shadow_reflection_talent) or SpellCooldown(shadow_reflection) > 30 or BuffRemaining(shadow_reflection_buff) > 3 } CombatKillingSpreeCdActions()
+	}
 }

-AddFunction CombatAdrenalineRushActions
+### actions.adrenaline_rush
+
+AddFunction CombatAdrenalineRushCdActions
 {
 	#adrenaline_rush,if=time_to_die>=44
 	if TimeToDie() >= 44 Spell(adrenaline_rush)
@@ -102,7 +126,9 @@ AddFunction CombatAdrenalineRushActions
 	if TimeToDie() <= BaseDuration(adrenaline_rush_buff) * 1.5 Spell(adrenaline_rush)
 }

-AddFunction CombatFinisherActions
+### actions.finisher
+
+AddFunction CombatFinisherMainActions
 {
 	#death_from_above
 	Spell(death_from_above)
@@ -110,7 +136,9 @@ AddFunction CombatFinisherActions
 	Spell(eviscerate)
 }

-AddFunction CombatGeneratorActions
+### actions.generator
+
+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)
@@ -118,7 +146,9 @@ AddFunction CombatGeneratorActions
 	if target.DebuffPresent(revealing_strike_debuff) Spell(sinister_strike)
 }

-AddFunction CombatKillingSpreeActions
+### actions.killing_spree
+
+AddFunction CombatKillingSpreeCdActions
 {
 	#killing_spree,if=time_to_die>=44
 	if TimeToDie() >= 44 Spell(killing_spree)
@@ -132,33 +162,76 @@ AddFunction CombatKillingSpreeActions
 	if TimeToDie() <= BaseDuration(killing_spree_buff) * 1.5 Spell(killing_spree)
 }

-AddFunction CombatPrecombatActions
+### actions.precombat
+
+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
-	#potion,name=draenic_agility
-	UsePotionAgility()
 	#stealth
 	if BuffExpires(stealthed_buff any=1) Spell(stealth)
-	#marked_for_death
-	Spell(marked_for_death)
 	#slice_and_dice,if=talent.marked_for_death.enabled
 	if Talent(marked_for_death_talent) and BuffRemaining(slice_and_dice_buff) < BaseDuration(slice_and_dice_buff) Spell(slice_and_dice)
 }

+AddFunction CombatPrecombatShortCdActions
+{
+	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)
+	}
+}
+
+AddFunction CombatPrecombatCdActions
+{
+	unless BuffRemaining(lethal_poison_buff) < 1200 and Spell(deadly_poison)
+	{
+		#snapshot_stats
+		#potion,name=draenic_agility
+		UsePotionAgility()
+	}
+}
+
+### Combat icons.
+AddCheckBox(opt_rogue_combat_aoe L(AOE) specialization=combat default)
+
+AddIcon specialization=combat help=shortcd enemies=1 checkbox=!opt_rogue_combat_aoe
+{
+	if not InCombat() CombatPrecombatShortCdActions()
+	CombatDefaultShortCdActions()
+}
+
+AddIcon specialization=combat help=shortcd checkbox=opt_rogue_combat_aoe
+{
+	if not InCombat() CombatPrecombatShortCdActions()
+	CombatDefaultShortCdActions()
+}
+
 AddIcon specialization=combat help=main enemies=1
 {
-	if not InCombat() CombatPrecombatActions()
-	CombatDefaultActions()
+	if not InCombat() CombatPrecombatMainActions()
+	CombatDefaultMainActions()
+}
+
+AddIcon specialization=combat help=aoe checkbox=opt_rogue_combat_aoe
+{
+	if not InCombat() CombatPrecombatMainActions()
+	CombatDefaultMainActions()
+}
+
+AddIcon specialization=combat help=cd enemies=1 checkbox=!opt_rogue_combat_aoe
+{
+	if not InCombat() CombatPrecombatCdActions()
+	CombatDefaultCdActions()
 }

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

 ### Required symbols
@@ -184,7 +257,6 @@ AddIcon specialization=combat help=aoe
 # kidney_shot
 # killing_spree
 # killing_spree_buff
-# lethal_poison_buff
 # marked_for_death
 # marked_for_death_talent
 # preparation
@@ -202,7 +274,6 @@ AddIcon specialization=combat help=aoe
 # stealth
 # subterfuge_talent
 # vanish
-# vanish_buff
 ]]
 	OvaleScripts:RegisterScript("ROGUE", name, desc, code, "reference")
 end
diff --git a/scripts/simulationcraft_rogue_subtlety.lua b/scripts/simulationcraft_rogue_subtlety.lua
index 080e0da..9172388 100644
--- a/scripts/simulationcraft_rogue_subtlety.lua
+++ b/scripts/simulationcraft_rogue_subtlety.lua
@@ -8,8 +8,8 @@ do
 # Based on SimulationCraft profile "Rogue_Subtlety_T17M".
 #	class=rogue
 #	spec=subtlety
-#	talents=3111122
-#	glyphs=energy/hemorrhaging_veins
+#	talents=2111122
+#	glyphs=energy/hemorrhaging_veins/vanish

 Include(ovale_common)
 Include(ovale_rogue_spells)
@@ -56,22 +56,10 @@ AddFunction InterruptActions
 	}
 }

-AddFunction SubtletyDefaultActions
+### actions.default
+
+AddFunction SubtletyDefaultMainActions
 {
-	#potion,name=draenic_agility,if=buff.bloodlust.react|target.time_to_die<40|buff.shadow_dance.up&(trinket.proc.agi.react|trinket.proc.multistrike.react|trinket.stacking_proc.agi.react|trinket.stacking_proc.multistrike.react|buff.archmages_greater_incandescence_agi.react)
-	if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() < 40 or BuffPresent(shadow_dance_buff) and { BuffPresent(trinket_proc_agi_buff) or BuffPresent(trinket_proc_multistrike_buff) or BuffPresent(trinket_stacking_proc_agi_buff) or BuffPresent(trinket_stacking_proc_multistrike_buff) or BuffPresent(archmages_greater_incandescence_agi_buff) } UsePotionAgility()
-	#kick
-	InterruptActions()
-	#use_item,slot=trinket2,if=buff.shadow_dance.up
-	if BuffPresent(shadow_dance_buff) UseItemActions()
-	#shadow_reflection,if=buff.shadow_dance.up
-	if BuffPresent(shadow_dance_buff) Spell(shadow_reflection)
-	#blood_fury,if=buff.shadow_dance.up
-	if BuffPresent(shadow_dance_buff) Spell(blood_fury_ap)
-	#berserking,if=buff.shadow_dance.up
-	if BuffPresent(shadow_dance_buff) Spell(berserking)
-	#arcane_torrent,if=energy<60&buff.shadow_dance.up
-	if Energy() < 60 and BuffPresent(shadow_dance_buff) Spell(arcane_torrent_energy)
 	#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
 	if 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 Spell(slice_and_dice)
 	#premeditation,if=combo_points<=4&!(buff.shadow_dance.up&energy>100&combo_points>1)&!buff.subterfuge.up|(buff.subterfuge.up&debuff.find_weakness.up)
@@ -81,8 +69,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)
 	{
-		#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
+		#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)
@@ -91,32 +79,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))
-				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 { 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) } } 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
-					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)
-					#Remove any 'Energy() >= 50' condition from the following statement.
-					unless 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) 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)
-						#Remove any 'Energy() >= 90' condition from the following statement.
-						unless 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) 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)
 							#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()
-							#run_action_list,name=pool
-							SubtletyPoolActions()
+							if ComboPoints() < 4 or ComboPoints() == 4 and BuffRemaining(honor_among_thieves_cooldown_buff) > 1 and Energy() > 70 - EnergyRegenRate() or Talent(anticipation_talent) SubtletyGeneratorMainActions()
 						}
 					}
 				}
@@ -125,7 +103,109 @@ AddFunction SubtletyDefaultActions
 	}
 }

-AddFunction SubtletyFinisherActions
+AddFunction SubtletyDefaultShortCdActions
+{
+	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)
+	{
+		#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)
+		{
+			#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)
+				unless { ComboPoints() < 5 or Talent(anticipation_talent) and BuffStacks(anticipation_buff) < 3 and { TimeInCombat() < 1.2 or BuffPresent(shadow_dance_buff) or TimeInCombat() > 5 } } and SpellUsable(ambush) and SpellCooldown(ambush) < TimeToEnergyFor(ambush)
+				{
+					#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 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 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 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)
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+AddFunction SubtletyDefaultCdActions
+{
+	#potion,name=draenic_agility,if=buff.bloodlust.react|target.time_to_die<40|buff.shadow_dance.up&(trinket.proc.agi.react|trinket.proc.multistrike.react|trinket.stacking_proc.agi.react|trinket.stacking_proc.multistrike.react|buff.archmages_greater_incandescence_agi.react)
+	if BuffPresent(burst_haste_buff any=1) or target.TimeToDie() < 40 or BuffPresent(shadow_dance_buff) and { BuffPresent(trinket_proc_agi_buff) or BuffPresent(trinket_proc_multistrike_buff) or BuffPresent(trinket_stacking_proc_agi_buff) or BuffPresent(trinket_stacking_proc_multistrike_buff) or BuffPresent(archmages_greater_incandescence_agi_buff) } UsePotionAgility()
+	#kick
+	InterruptActions()
+	#use_item,slot=trinket2,if=buff.shadow_dance.up
+	if BuffPresent(shadow_dance_buff) UseItemActions()
+	#shadow_reflection,if=buff.shadow_dance.up
+	if BuffPresent(shadow_dance_buff) Spell(shadow_reflection)
+	#blood_fury,if=buff.shadow_dance.up
+	if BuffPresent(shadow_dance_buff) Spell(blood_fury_ap)
+	#berserking,if=buff.shadow_dance.up
+	if BuffPresent(shadow_dance_buff) Spell(berserking)
+	#arcane_torrent,if=energy<60&buff.shadow_dance.up
+	if Energy() < 60 and BuffPresent(shadow_dance_buff) Spell(arcane_torrent_energy)
+
+	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)
+	{
+		#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)
+		{
+			#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)
+				unless { ComboPoints() < 5 or Talent(anticipation_talent) and BuffStacks(anticipation_buff) < 3 and { TimeInCombat() < 1.2 or BuffPresent(shadow_dance_buff) or TimeInCombat() > 5 } } and SpellUsable(ambush) and SpellCooldown(ambush) < TimeToEnergyFor(ambush)
+				{
+					#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 { 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 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 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()
+								#run_action_list,name=finisher,if=combo_points=5
+								if ComboPoints() == 5 SubtletyFinisherCdActions()
+								#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) SubtletyGeneratorCdActions()
+								#run_action_list,name=pool
+								SubtletyPoolCdActions()
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+### actions.finisher
+
+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)
@@ -137,14 +217,21 @@ AddFunction SubtletyFinisherActions
 	if 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) } Spell(crimson_tempest)
 	#eviscerate,if=active_enemies<4|(active_enemies>3&dot.crimson_tempest_dot.ticks_remain>=2)&(cooldown.death_from_above.remains>0|!talent.death_from_above.enabled)
 	if 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) } Spell(eviscerate)
-	#run_action_list,name=pool
-	SubtletyPoolActions()
 }

-AddFunction SubtletyGeneratorActions
+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)
+	{
+		#run_action_list,name=pool
+		SubtletyPoolCdActions()
+	}
+}
+
+### actions.generator
+
+AddFunction SubtletyGeneratorMainActions
 {
-	#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 } SubtletyPoolActions()
 	#fan_of_knives,if=active_enemies>1
 	if Enemies() > 1 Spell(fan_of_knives)
 	#shuriken_toss,if=energy<65&energy.regen<16
@@ -153,42 +240,87 @@ AddFunction SubtletyGeneratorActions
 	Spell(backstab)
 	#hemorrhage,if=position_front
 	if False(position_front) Spell(hemorrhage)
-	#run_action_list,name=pool
-	SubtletyPoolActions()
 }

-AddFunction SubtletyPoolActions
+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)
+	{
+		#run_action_list,name=pool
+		SubtletyPoolCdActions()
+	}
+}
+
+### 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)
 }

-AddFunction SubtletyPrecombatActions
+### actions.precombat
+
+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
-	#potion,name=draenic_agility
-	UsePotionAgility()
 	#stealth
 	if BuffExpires(stealthed_buff any=1) Spell(stealth)
 	#slice_and_dice
 	Spell(slice_and_dice)
-	#honor_among_thieves,cooldown=2.2,cooldown_stddev=0.1
+}
+
+AddFunction SubtletyPrecombatCdActions
+{
+	unless BuffRemaining(lethal_poison_buff) < 1200 and Spell(deadly_poison)
+	{
+		#snapshot_stats
+		#potion,name=draenic_agility
+		UsePotionAgility()
+	}
+}
+
+### Subtlety icons.
+AddCheckBox(opt_rogue_subtlety_aoe L(AOE) specialization=subtlety default)
+
+AddIcon specialization=subtlety help=shortcd enemies=1 checkbox=!opt_rogue_subtlety_aoe
+{
+	SubtletyDefaultShortCdActions()
+}
+
+AddIcon specialization=subtlety help=shortcd checkbox=opt_rogue_subtlety_aoe
+{
+	SubtletyDefaultShortCdActions()
 }

 AddIcon specialization=subtlety help=main enemies=1
 {
-	if not InCombat() SubtletyPrecombatActions()
-	SubtletyDefaultActions()
+	if not InCombat() SubtletyPrecombatMainActions()
+	SubtletyDefaultMainActions()
+}
+
+AddIcon specialization=subtlety help=aoe checkbox=opt_rogue_subtlety_aoe
+{
+	if not InCombat() SubtletyPrecombatMainActions()
+	SubtletyDefaultMainActions()
+}
+
+AddIcon specialization=subtlety help=cd enemies=1 checkbox=!opt_rogue_subtlety_aoe
+{
+	if not InCombat() SubtletyPrecombatCdActions()
+	SubtletyDefaultCdActions()
 }

-AddIcon specialization=subtlety help=aoe
+AddIcon specialization=subtlety help=cd checkbox=opt_rogue_subtlety_aoe
 {
-	if not InCombat() SubtletyPrecombatActions()
-	SubtletyDefaultActions()
+	if not InCombat() SubtletyPrecombatCdActions()
+	SubtletyDefaultCdActions()
 }

 ### Required symbols
@@ -218,7 +350,6 @@ AddIcon specialization=subtlety help=aoe
 # honor_among_thieves_cooldown_buff
 # kick
 # kidney_shot
-# lethal_poison_buff
 # marked_for_death
 # master_of_subtlety_buff
 # premeditation
@@ -240,7 +371,6 @@ AddIcon specialization=subtlety help=aoe
 # trinket_proc_agi_buff
 # trinket_stacking_proc_agi_buff
 # vanish
-# vanish_buff
 ]]
 	OvaleScripts:RegisterScript("ROGUE", name, desc, code, "reference")
 end
diff --git a/scripts/simulationcraft_shaman_elemental.lua b/scripts/simulationcraft_shaman_elemental.lua
index 76b3d5f..2042896 100644
--- a/scripts/simulationcraft_shaman_elemental.lua
+++ b/scripts/simulationcraft_shaman_elemental.lua
@@ -45,7 +45,31 @@ AddFunction InterruptActions
 	}
 }

-AddFunction ElementalDefaultActions
+### actions.default
+
+AddFunction ElementalDefaultMainActions
+{
+	#call_action_list,name=single,if=active_enemies=1
+	if Enemies() == 1 ElementalSingleMainActions()
+	#call_action_list,name=aoe,if=active_enemies>1
+	if Enemies() > 1 ElementalAoeMainActions()
+}
+
+AddFunction ElementalDefaultShortCdActions
+{
+	#elemental_mastery,if=action.lava_burst.cast_time>=1.2
+	if CastTime(lava_burst) >= 1.2 Spell(elemental_mastery)
+	#ancestral_swiftness,if=!buff.ascendance.up
+	if not BuffPresent(ascendance_caster_buff) Spell(ancestral_swiftness)
+	#liquid_magma,if=pet.searing_totem.remains>=15|pet.fire_elemental_totem.remains>=15
+	if TotemRemaining(searing_totem) >= 15 or TotemRemaining(fire_elemental_totem) >= 15 Spell(liquid_magma)
+	#call_action_list,name=single,if=active_enemies=1
+	if Enemies() == 1 ElementalSingleShortCdActions()
+	#call_action_list,name=aoe,if=active_enemies>1
+	if Enemies() > 1 ElementalAoeShortCdActions()
+}
+
+AddFunction ElementalDefaultCdActions
 {
 	#wind_shear
 	InterruptActions()
@@ -59,34 +83,28 @@ AddFunction ElementalDefaultActions
 	if BuffPresent(burst_haste_buff any=1) or BuffPresent(ascendance_caster_buff) or { SpellCooldown(ascendance_caster) > 10 or Level() < 87 } and SpellCooldown(fire_elemental_totem) > 10 Spell(blood_fury_apsp)
 	#arcane_torrent
 	Spell(arcane_torrent_mana)
-	#elemental_mastery,if=action.lava_burst.cast_time>=1.2
-	if CastTime(lava_burst) >= 1.2 Spell(elemental_mastery)
-	#ancestral_swiftness,if=!buff.ascendance.up
-	if not BuffPresent(ascendance_caster_buff) Spell(ancestral_swiftness)
 	#storm_elemental_totem
 	Spell(storm_elemental_totem)
 	#fire_elemental_totem,if=!active
 	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)
-	#liquid_magma,if=pet.searing_totem.remains>=15|pet.fire_elemental_totem.remains>=15
-	if TotemRemaining(searing_totem) >= 15 or TotemRemaining(fire_elemental_totem) >= 15 Spell(liquid_magma)
-	#call_action_list,name=single,if=active_enemies=1
-	if Enemies() == 1 ElementalSingleActions()
-	#call_action_list,name=aoe,if=active_enemies>1
-	if Enemies() > 1 ElementalAoeActions()
+
+	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()
+	}
 }

-AddFunction ElementalAoeActions
+### actions.aoe
+
+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
@@ -95,23 +113,44 @@ AddFunction ElementalAoeActions
 	Spell(lightning_bolt)
 }

-AddFunction ElementalPrecombatActions
+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)
+
+	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)
+	}
+}
+
+### actions.precombat
+
+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
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 }

-AddFunction ElementalSingleActions
+AddFunction ElementalPrecombatCdActions
+{
+	unless not BuffPresent(lightning_shield_buff) and Spell(lightning_shield)
+	{
+		#snapshot_stats
+		#potion,name=draenic_intellect
+		UsePotionIntellect()
+	}
+}
+
+### actions.single
+
+AddFunction ElementalSingleMainActions
 {
 	#unleash_flame,moving=1
 	if Speed() > 0 Spell(unleash_flame)
-	#spiritwalkers_grace,moving=1,if=buff.ascendance.up
-	if Speed() > 0 and BuffPresent(ascendance_caster_buff) Spell(spiritwalkers_grace)
 	#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)
 	#lava_burst,if=dot.flame_shock.remains>cast_time&(buff.ascendance.up|cooldown_react)
@@ -122,40 +161,85 @@ AddFunction ElementalSingleActions
 	if target.DebuffRemaining(flame_shock_debuff) <= 9 Spell(flame_shock)
 	#earth_shock,if=(set_bonus.tier17_4pc&buff.lightning_shield.react>=15&!buff.lava_surge.up)|(!set_bonus.tier17_4pc&buff.lightning_shield.react>15)
 	if 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 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)
 	#elemental_blast
 	Spell(elemental_blast)
 	#flame_shock,if=time>60&remains<=buff.ascendance.duration&cooldown.ascendance.remains+buff.ascendance.duration<duration
 	if TimeInCombat() > 60 and target.DebuffRemaining(flame_shock_debuff) <= BaseDuration(ascendance_caster_buff) and SpellCooldown(ascendance_caster) + BaseDuration(ascendance_caster_buff) < BaseDuration(flame_shock_debuff) Spell(flame_shock)
 	#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)
-	#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)
 	#lightning_bolt
 	Spell(lightning_bolt)
 }

+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) 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)
+		{
+			#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)
+		}
+	}
+}
+
+### Elemental icons.
+AddCheckBox(opt_shaman_elemental_aoe L(AOE) specialization=elemental default)
+
+AddIcon specialization=elemental help=shortcd enemies=1 checkbox=!opt_shaman_elemental_aoe
+{
+	ElementalDefaultShortCdActions()
+}
+
+AddIcon specialization=elemental help=shortcd checkbox=opt_shaman_elemental_aoe
+{
+	ElementalDefaultShortCdActions()
+}
+
 AddIcon specialization=elemental help=main enemies=1
 {
-	if not InCombat() ElementalPrecombatActions()
-	ElementalDefaultActions()
+	if not InCombat() ElementalPrecombatMainActions()
+	ElementalDefaultMainActions()
+}
+
+AddIcon specialization=elemental help=aoe checkbox=opt_shaman_elemental_aoe
+{
+	if not InCombat() ElementalPrecombatMainActions()
+	ElementalDefaultMainActions()
+}
+
+AddIcon specialization=elemental help=cd enemies=1 checkbox=!opt_shaman_elemental_aoe
+{
+	if not InCombat() ElementalPrecombatCdActions()
+	ElementalDefaultCdActions()
 }

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

 ### Required symbols
diff --git a/scripts/simulationcraft_shaman_enhancement.lua b/scripts/simulationcraft_shaman_enhancement.lua
index 097baec..b71d750 100644
--- a/scripts/simulationcraft_shaman_enhancement.lua
+++ b/scripts/simulationcraft_shaman_enhancement.lua
@@ -52,7 +52,27 @@ AddFunction InterruptActions
 	}
 }

-AddFunction EnhancementDefaultActions
+### actions.default
+
+AddFunction EnhancementDefaultMainActions
+{
+	#call_action_list,name=single,if=active_enemies=1
+	if Enemies() == 1 EnhancementSingleMainActions()
+	#call_action_list,name=aoe,if=active_enemies>1
+	if Enemies() > 1 EnhancementAoeMainActions()
+}
+
+AddFunction EnhancementDefaultShortCdActions
+{
+	#elemental_mastery
+	Spell(elemental_mastery)
+	#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
 {
 	#wind_shear
 	InterruptActions()
@@ -69,8 +89,6 @@ AddFunction EnhancementDefaultActions
 	Spell(arcane_torrent_mana)
 	#berserking
 	Spell(berserking)
-	#elemental_mastery
-	Spell(elemental_mastery)
 	#storm_elemental_totem
 	Spell(storm_elemental_totem)
 	#fire_elemental_totem,if=(talent.primal_elementalist.enabled&active_enemies<=10)|active_enemies<=6
@@ -79,17 +97,11 @@ AddFunction EnhancementDefaultActions
 	if BuffExpires(ascendance_melee_buff) Spell(ascendance_melee)
 	#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)
-	#call_action_list,name=single,if=active_enemies=1
-	if Enemies() == 1 EnhancementSingleActions()
-	#call_action_list,name=aoe,if=active_enemies>1
-	if Enemies() > 1 EnhancementAoeActions()
 }

-AddFunction EnhancementAoeActions
+### actions.aoe
+
+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)
@@ -137,18 +149,29 @@ AddFunction EnhancementAoeActions
 	}
 }

-AddFunction EnhancementPrecombatActions
+### actions.precombat
+
+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
-	#potion,name=draenic_agility
-	UsePotionAgility()
 }

-AddFunction EnhancementSingleActions
+AddFunction EnhancementPrecombatCdActions
+{
+	unless not BuffPresent(lightning_shield_buff) and Spell(lightning_shield)
+	{
+		#snapshot_stats
+		#potion,name=draenic_agility
+		UsePotionAgility()
+	}
+}
+
+### actions.single
+
+AddFunction EnhancementSingleMainActions
 {
 	#searing_totem,if=!totem.fire.active
 	if not TotemPresent(fire) Spell(searing_totem)
@@ -178,16 +201,41 @@ AddFunction EnhancementSingleActions
 	if TotemRemaining(searing_totem) <= 20 and not TotemPresent(fire_elemental_totem) and not BuffPresent(liquid_magma_buff) Spell(searing_totem)
 }

+### Enhancement icons.
+AddCheckBox(opt_shaman_enhancement_aoe L(AOE) specialization=enhancement default)
+
+AddIcon specialization=enhancement help=shortcd enemies=1 checkbox=!opt_shaman_enhancement_aoe
+{
+	EnhancementDefaultShortCdActions()
+}
+
+AddIcon specialization=enhancement help=shortcd checkbox=opt_shaman_enhancement_aoe
+{
+	EnhancementDefaultShortCdActions()
+}
+
 AddIcon specialization=enhancement help=main enemies=1
 {
-	if not InCombat() EnhancementPrecombatActions()
-	EnhancementDefaultActions()
+	if not InCombat() EnhancementPrecombatMainActions()
+	EnhancementDefaultMainActions()
+}
+
+AddIcon specialization=enhancement help=aoe checkbox=opt_shaman_enhancement_aoe
+{
+	if not InCombat() EnhancementPrecombatMainActions()
+	EnhancementDefaultMainActions()
+}
+
+AddIcon specialization=enhancement help=cd enemies=1 checkbox=!opt_shaman_enhancement_aoe
+{
+	if not InCombat() EnhancementPrecombatCdActions()
+	EnhancementDefaultCdActions()
 }

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

 ### Required symbols
diff --git a/scripts/simulationcraft_warlock_affliction.lua b/scripts/simulationcraft_warlock_affliction.lua
index 920a084..489787c 100644
--- a/scripts/simulationcraft_warlock_affliction.lua
+++ b/scripts/simulationcraft_warlock_affliction.lua
@@ -21,32 +21,12 @@ AddFunction UsePotionIntellect
 	if CheckBoxOn(opt_potion_intellect) and target.Classification(worldboss) Item(draenic_intellect_potion usable=1)
 }

-AddFunction AfflictionDefaultActions
+### actions.default
+
+AddFunction AfflictionDefaultMainActions
 {
-	#potion,name=draenic_intellect,if=buff.bloodlust.react|target.health.pct<=20
-	if BuffPresent(burst_haste_buff any=1) or target.HealthPercent() <= 20 UsePotionIntellect()
-	#berserking
-	Spell(berserking)
-	#blood_fury
-	Spell(blood_fury_sp)
-	#arcane_torrent
-	Spell(arcane_torrent_mana)
-	#mannoroths_fury
-	Spell(mannoroths_fury)
-	#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_misery) == 2 or BuffPresent(trinket_proc_intellect_buff) or BuffStacks(trinket_stacking_proc_intellect_buff) > 6 or target.HealthPercent() <= 10 } Spell(dark_soul_misery)
-	#service_pet,if=talent.grimoire_of_service.enabled
-	if Talent(grimoire_of_service_talent) 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)
-	#cataclysm
-	Spell(cataclysm)
 	#haunt,if=shard_react&!talent.soulburn_haunt.enabled&!in_flight_to_target&(dot.haunt.remains<cast_time+travel_time|soul_shard=4)&(trinket.proc.any.react|trinket.stacking_proc.any.react>6|buff.dark_soul.up|soul_shard>2|soul_shard*14<=target.time_to_die)
 	if 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() } 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)
 	#haunt,if=shard_react&talent.soulburn_haunt.enabled&!in_flight_to_target&((buff.soulburn.up&buff.haunting_spirits.remains<5)|soul_shard=4)
 	if SoulShards() >= 1 and Talent(soulburn_haunt_talent) and not InFlightToTarget(haunt) and { BuffPresent(soulburn_buff) and BuffRemaining(haunting_spirits_buff) < 5 or SoulShards() == 4 } Spell(haunt)
 	#agony,cycle_targets=1,if=target.time_to_die>16&remains<=(duration*0.3)&((talent.cataclysm.enabled&remains<=(cooldown.cataclysm.remains+action.cataclysm.cast_time))|!talent.cataclysm.enabled)
@@ -65,37 +45,126 @@ AddFunction AfflictionDefaultActions
 	Spell(life_tap)
 }

-AddFunction AfflictionPrecombatActions
+AddFunction AfflictionDefaultShortCdActions
+{
+	#mannoroths_fury
+	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) + 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)
+	}
+}
+
+AddFunction AfflictionDefaultCdActions
+{
+	#potion,name=draenic_intellect,if=buff.bloodlust.react|target.health.pct<=20
+	if BuffPresent(burst_haste_buff any=1) or target.HealthPercent() <= 20 UsePotionIntellect()
+	#berserking
+	Spell(berserking)
+	#blood_fury
+	Spell(blood_fury_sp)
+	#arcane_torrent
+	Spell(arcane_torrent_mana)
+	#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_misery) == 2 or BuffPresent(trinket_proc_intellect_buff) or BuffStacks(trinket_stacking_proc_intellect_buff) > 6 or target.HealthPercent() <= 10 } Spell(dark_soul_misery)
+
+	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)
+	}
+}
+
+### actions.precombat
+
+AddFunction AfflictionPrecombatMainActions
 {
 	#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)
-	#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_felhunter)
-	#summon_doomguard,if=talent.demonic_servitude.enabled&active_enemies<5
-	if Talent(demonic_servitude_talent) and Enemies() < 5 Spell(summon_doomguard)
-	#summon_infernal,if=talent.demonic_servitude.enabled&active_enemies>=5
-	if Talent(demonic_servitude_talent) and Enemies() >= 5 Spell(summon_infernal)
 	#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)
-	#service_pet,if=talent.grimoire_of_service.enabled
-	if Talent(grimoire_of_service_talent) Spell(grimoire_felhunter)
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
+}
+
+AddFunction AfflictionPrecombatShortCdActions
+{
+	unless not BuffPresent(spell_power_multiplier_buff any=1) and Spell(dark_intent)
+	{
+		#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_felhunter)
+		#service_pet,if=talent.grimoire_of_service.enabled
+		if Talent(grimoire_of_service_talent) Spell(grimoire_felhunter)
+	}
+}
+
+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)
+	{
+		#summon_doomguard,if=talent.demonic_servitude.enabled&active_enemies<5
+		if Talent(demonic_servitude_talent) and Enemies() < 5 Spell(summon_doomguard)
+		#summon_infernal,if=talent.demonic_servitude.enabled&active_enemies>=5
+		if Talent(demonic_servitude_talent) and Enemies() >= 5 Spell(summon_infernal)
+
+		unless Talent(grimoire_of_service_talent) and Spell(grimoire_felhunter)
+		{
+			#potion,name=draenic_intellect
+			UsePotionIntellect()
+		}
+	}
+}
+
+### Affliction icons.
+AddCheckBox(opt_warlock_affliction_aoe L(AOE) specialization=affliction default)
+
+AddIcon specialization=affliction help=shortcd enemies=1 checkbox=!opt_warlock_affliction_aoe
+{
+	if not InCombat() AfflictionPrecombatShortCdActions()
+	AfflictionDefaultShortCdActions()
+}
+
+AddIcon specialization=affliction help=shortcd checkbox=opt_warlock_affliction_aoe
+{
+	if not InCombat() AfflictionPrecombatShortCdActions()
+	AfflictionDefaultShortCdActions()
 }

 AddIcon specialization=affliction help=main enemies=1
 {
-	if not InCombat() AfflictionPrecombatActions()
-	AfflictionDefaultActions()
+	if not InCombat() AfflictionPrecombatMainActions()
+	AfflictionDefaultMainActions()
+}
+
+AddIcon specialization=affliction help=aoe checkbox=opt_warlock_affliction_aoe
+{
+	if not InCombat() AfflictionPrecombatMainActions()
+	AfflictionDefaultMainActions()
+}
+
+AddIcon specialization=affliction help=cd enemies=1 checkbox=!opt_warlock_affliction_aoe
+{
+	if not InCombat() AfflictionPrecombatCdActions()
+	AfflictionDefaultCdActions()
 }

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

 ### Required symbols
@@ -123,6 +192,7 @@ AddIcon specialization=affliction help=aoe
 # haunt
 # haunt_debuff
 # haunting_spirits_buff
+# kiljaedens_cunning
 # life_tap
 # mannoroths_fury
 # soulburn
diff --git a/scripts/simulationcraft_warlock_demonology.lua b/scripts/simulationcraft_warlock_demonology.lua
index fea01d3..b252654 100644
--- a/scripts/simulationcraft_warlock_demonology.lua
+++ b/scripts/simulationcraft_warlock_demonology.lua
@@ -22,44 +22,18 @@ AddFunction UsePotionIntellect
 	if CheckBoxOn(opt_potion_intellect) and target.Classification(worldboss) Item(draenic_intellect_potion usable=1)
 }

-AddFunction DemonologyDefaultActions
+### actions.default
+
+AddFunction DemonologyDefaultMainActions
 {
-	#potion,name=draenic_intellect,if=buff.bloodlust.react|(buff.dark_soul.up&(trinket.proc.any.react|trinket.stacking_proc.any.react>6)&!buff.demonbolt.remains)|target.health.pct<20
-	if BuffPresent(burst_haste_buff any=1) or BuffPresent(dark_soul_knowledge_buff) and { BuffPresent(trinket_proc_any_buff) or BuffStacks(trinket_stacking_proc_any_buff) > 6 } and not BuffPresent(demonbolt_buff) or target.HealthPercent() < 20 UsePotionIntellect()
-	#berserking
-	Spell(berserking)
-	#blood_fury
-	Spell(blood_fury_sp)
-	#arcane_torrent
-	Spell(arcane_torrent_mana)
-	#mannoroths_fury
-	Spell(mannoroths_fury)
-	#dark_soul,if=talent.demonbolt.enabled&(charges=2|target.time_to_die<buff.demonbolt.remains|(!buff.demonbolt.remains&demonic_fury>=790))
-	if Talent(demonbolt_talent) and { Charges(dark_soul_knowledge) == 2 or target.TimeToDie() < BuffRemaining(demonbolt_buff) or not BuffPresent(demonbolt_buff) and DemonicFury() >= 790 } Spell(dark_soul_knowledge)
-	#dark_soul,if=!talent.demonbolt.enabled&(charges=2|!talent.archimondes_darkness.enabled|(target.time_to_die<=20&!glyph.dark_soul.enabled|target.time_to_die<=10)|(target.time_to_die<=60&demonic_fury>400)|((trinket.stacking_proc.multistrike.remains>7.5|trinket.proc.any.remains>7.5)&demonic_fury>=400))
-	if not Talent(demonbolt_talent) and { Charges(dark_soul_knowledge) == 2 or not Talent(archimondes_darkness_talent) or target.TimeToDie() <= 20 and not Glyph(glyph_of_dark_soul) or target.TimeToDie() <= 10 or target.TimeToDie() <= 60 and DemonicFury() > 400 or { BuffRemaining(trinket_stacking_proc_multistrike_buff) > 7.5 or BuffRemaining(trinket_proc_any_buff) > 7.5 } and DemonicFury() >= 400 } Spell(dark_soul_knowledge)
-	#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)
-	#felguard:felstorm
-	if pet.Present() and pet.CreatureFamily(Felguard) Spell(felguard_felstorm)
-	#wrathguard:wrathstorm
-	if pet.Present() and pet.CreatureFamily(Wrathguard) Spell(wrathguard_wrathstorm)
 	#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(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)
-	#service_pet,if=talent.grimoire_of_service.enabled
-	if Talent(grimoire_of_service_talent) 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)
-	#summon_infernal,if=!talent.demonic_servitude.enabled&active_enemies>=5
-	if not Talent(demonic_servitude_talent) and Enemies() >= 5 Spell(summon_infernal)
 	#call_action_list,name=db,if=talent.demonbolt.enabled
-	if Talent(demonbolt_talent) DemonologyDbActions()
-	#cataclysm,if=buff.metamorphosis.up
-	if BuffPresent(metamorphosis_buff) Spell(cataclysm)
+	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)&trinket.stacking_proc.multistrike.react<10
@@ -75,13 +49,13 @@ AddFunction DemonologyDefaultActions
 	#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)
+	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)&(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) >= 1 or DemonicFury() >= 40 } Spell(metamorphosis)
+	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
@@ -97,9 +71,9 @@ AddFunction DemonologyDefaultActions
 	#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.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)
+	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
@@ -112,7 +86,57 @@ AddFunction DemonologyDefaultActions
 	Spell(life_tap)
 }

-AddFunction DemonologyDbActions
+AddFunction DemonologyDefaultShortCdActions
+{
+	#mannoroths_fury
+	Spell(mannoroths_fury)
+	#felguard:felstorm
+	if pet.Present() and pet.CreatureFamily(Felguard) Spell(felguard_felstorm)
+	#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 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)
+	}
+}
+
+AddFunction DemonologyDefaultCdActions
+{
+	#potion,name=draenic_intellect,if=buff.bloodlust.react|(buff.dark_soul.up&(trinket.proc.any.react|trinket.stacking_proc.any.react>6)&!buff.demonbolt.remains)|target.health.pct<20
+	if BuffPresent(burst_haste_buff any=1) or BuffPresent(dark_soul_knowledge_buff) and { BuffPresent(trinket_proc_any_buff) or BuffStacks(trinket_stacking_proc_any_buff) > 6 } and not BuffPresent(demonbolt_buff) or target.HealthPercent() < 20 UsePotionIntellect()
+	#berserking
+	Spell(berserking)
+	#blood_fury
+	Spell(blood_fury_sp)
+	#arcane_torrent
+	Spell(arcane_torrent_mana)
+	#dark_soul,if=talent.demonbolt.enabled&(charges=2|target.time_to_die<buff.demonbolt.remains|(!buff.demonbolt.remains&demonic_fury>=790))
+	if Talent(demonbolt_talent) and { Charges(dark_soul_knowledge) == 2 or target.TimeToDie() < BuffRemaining(demonbolt_buff) or not BuffPresent(demonbolt_buff) and DemonicFury() >= 790 } Spell(dark_soul_knowledge)
+	#dark_soul,if=!talent.demonbolt.enabled&(charges=2|!talent.archimondes_darkness.enabled|(target.time_to_die<=20&!glyph.dark_soul.enabled|target.time_to_die<=10)|(target.time_to_die<=60&demonic_fury>400)|((trinket.stacking_proc.multistrike.remains>7.5|trinket.proc.any.remains>7.5)&demonic_fury>=400))
+	if not Talent(demonbolt_talent) and { Charges(dark_soul_knowledge) == 2 or not Talent(archimondes_darkness_talent) or target.TimeToDie() <= 20 and not Glyph(glyph_of_dark_soul) or target.TimeToDie() <= 10 or target.TimeToDie() <= 60 and DemonicFury() > 400 or { BuffRemaining(trinket_stacking_proc_multistrike_buff) > 7.5 or BuffRemaining(trinket_proc_any_buff) > 7.5 } and DemonicFury() >= 400 } Spell(dark_soul_knowledge)
+	#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 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)
+		#summon_infernal,if=!talent.demonic_servitude.enabled&active_enemies>=5
+		if not Talent(demonic_servitude_talent) and Enemies() >= 5 Spell(summon_infernal)
+	}
+}
+
+### actions.db
+
+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)
@@ -129,9 +153,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)
@@ -155,7 +179,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
@@ -168,37 +192,93 @@ AddFunction DemonologyDbActions
 	Spell(life_tap)
 }

-AddFunction DemonologyPrecombatActions
+AddFunction DemonologyDbShortCdActions
+{
+	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)
+	{
+		#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)
+	}
+}
+
+### actions.precombat
+
+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)
-	#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)
-	#summon_doomguard,if=talent.demonic_servitude.enabled&active_enemies<5
-	if Talent(demonic_servitude_talent) and Enemies() < 5 Spell(summon_doomguard)
-	#summon_infernal,if=talent.demonic_servitude.enabled&active_enemies>=5
-	if Talent(demonic_servitude_talent) and Enemies() >= 5 Spell(summon_infernal)
-	#snapshot_stats
-	#service_pet,if=talent.grimoire_of_service.enabled
-	if Talent(grimoire_of_service_talent) Spell(grimoire_felguard)
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#soul_fire
 	Spell(soul_fire)
 }

+AddFunction DemonologyPrecombatShortCdActions
+{
+	unless not BuffPresent(spell_power_multiplier_buff any=1) and Spell(dark_intent)
+	{
+		#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)
+	}
+}
+
+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)
+	{
+		#summon_doomguard,if=talent.demonic_servitude.enabled&active_enemies<5
+		if Talent(demonic_servitude_talent) and Enemies() < 5 Spell(summon_doomguard)
+		#summon_infernal,if=talent.demonic_servitude.enabled&active_enemies>=5
+		if Talent(demonic_servitude_talent) and Enemies() >= 5 Spell(summon_infernal)
+
+		unless Talent(grimoire_of_service_talent) and Spell(grimoire_felguard)
+		{
+			#potion,name=draenic_intellect
+			UsePotionIntellect()
+		}
+	}
+}
+
+### Demonology icons.
+AddCheckBox(opt_warlock_demonology_aoe L(AOE) specialization=demonology default)
+
+AddIcon specialization=demonology help=shortcd enemies=1 checkbox=!opt_warlock_demonology_aoe
+{
+	if not InCombat() DemonologyPrecombatShortCdActions()
+	DemonologyDefaultShortCdActions()
+}
+
+AddIcon specialization=demonology help=shortcd checkbox=opt_warlock_demonology_aoe
+{
+	if not InCombat() DemonologyPrecombatShortCdActions()
+	DemonologyDefaultShortCdActions()
+}
+
 AddIcon specialization=demonology help=main enemies=1
 {
-	if not InCombat() DemonologyPrecombatActions()
-	DemonologyDefaultActions()
+	if not InCombat() DemonologyPrecombatMainActions()
+	DemonologyDefaultMainActions()
+}
+
+AddIcon specialization=demonology help=aoe checkbox=opt_warlock_demonology_aoe
+{
+	if not InCombat() DemonologyPrecombatMainActions()
+	DemonologyDefaultMainActions()
+}
+
+AddIcon specialization=demonology help=cd enemies=1 checkbox=!opt_warlock_demonology_aoe
+{
+	if not InCombat() DemonologyPrecombatCdActions()
+	DemonologyDefaultCdActions()
 }

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

 ### Required symbols
@@ -233,11 +313,11 @@ AddIcon specialization=demonology help=aoe
 # immolation_aura
 # immolation_aura_buff
 # imp_swarm
+# kiljaedens_cunning
 # life_tap
 # mannoroths_fury
 # metamorphosis
 # metamorphosis_buff
-# molten_core_buff
 # shadow_bolt
 # shadowflame_debuff
 # soul_fire
diff --git a/scripts/simulationcraft_warlock_destruction.lua b/scripts/simulationcraft_warlock_destruction.lua
index dcddf76..916e665 100644
--- a/scripts/simulationcraft_warlock_destruction.lua
+++ b/scripts/simulationcraft_warlock_destruction.lua
@@ -21,7 +21,29 @@ AddFunction UsePotionIntellect
 	if CheckBoxOn(opt_potion_intellect) and target.Classification(worldboss) Item(draenic_intellect_potion usable=1)
 }

-AddFunction DestructionDefaultActions
+### actions.default
+
+AddFunction DestructionDefaultMainActions
+{
+	#run_action_list,name=single_target,if=active_enemies<6
+	if Enemies() < 6 DestructionSingleTargetMainActions()
+	#run_action_list,name=aoe,if=active_enemies>=6
+	if Enemies() >= 6 DestructionAoeMainActions()
+}
+
+AddFunction DestructionDefaultShortCdActions
+{
+	#mannoroths_fury
+	Spell(mannoroths_fury)
+	#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
+	if Enemies() >= 6 DestructionAoeShortCdActions()
+}
+
+AddFunction DestructionDefaultCdActions
 {
 	#potion,name=draenic_intellect,if=buff.bloodlust.react|target.health.pct<=20
 	if BuffPresent(burst_haste_buff any=1) or target.HealthPercent() <= 20 UsePotionIntellect()
@@ -31,36 +53,28 @@ AddFunction DestructionDefaultActions
 	Spell(blood_fury_sp)
 	#arcane_torrent
 	Spell(arcane_torrent_mana)
-	#mannoroths_fury
-	Spell(mannoroths_fury)
 	#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)
-	#service_pet,if=talent.grimoire_of_service.enabled
-	if Talent(grimoire_of_service_talent) 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 DestructionSingleTargetActions()
-	#run_action_list,name=aoe,if=active_enemies>=6
-	if Enemies() >= 6 DestructionAoeActions()
+
+	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)
+	}
 }

-AddFunction DestructionAoeActions
+### actions.aoe
+
+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)
-	#havoc,target=2
-	if Enemies() > 1 Spell(havoc text=other)
 	#shadowburn,if=buff.havoc.remains
 	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)
-	#cataclysm
-	Spell(cataclysm)
-	#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
@@ -73,51 +87,84 @@ AddFunction DestructionAoeActions
 	Spell(incinerate)
 }

-AddFunction DestructionPrecombatActions
+AddFunction DestructionAoeShortCdActions
+{
+	unless target.DebuffRemaining(rain_of_fire_debuff) <= target.TickTime(rain_of_fire_debuff) and Spell(rain_of_fire)
+	{
+		#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)
+		{
+			#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)
+		}
+	}
+}
+
+### actions.precombat
+
+AddFunction DestructionPrecombatMainActions
 {
 	#flask,type=greater_draenic_intellect_flask
 	#food,type=blackrock_barbecue
 	#dark_intent,if=!aura.spell_power_multiplier.up
 	if not BuffPresent(spell_power_multiplier_buff any=1) Spell(dark_intent)
-	#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_felhunter)
-	#summon_doomguard,if=talent.demonic_servitude.enabled&active_enemies<5
-	if Talent(demonic_servitude_talent) and Enemies() < 5 Spell(summon_doomguard)
-	#summon_infernal,if=talent.demonic_servitude.enabled&active_enemies>=5
-	if Talent(demonic_servitude_talent) and Enemies() >= 5 Spell(summon_infernal)
 	#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)
-	#service_pet,if=talent.grimoire_of_service.enabled
-	if Talent(grimoire_of_service_talent) Spell(grimoire_felhunter)
-	#potion,name=draenic_intellect
-	UsePotionIntellect()
 	#incinerate
 	Spell(incinerate)
 }

-AddFunction DestructionSingleTargetActions
+AddFunction DestructionPrecombatShortCdActions
+{
+	unless not BuffPresent(spell_power_multiplier_buff any=1) and Spell(dark_intent)
+	{
+		#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_felhunter)
+		#service_pet,if=talent.grimoire_of_service.enabled
+		if Talent(grimoire_of_service_talent) Spell(grimoire_felhunter)
+	}
+}
+
+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)
+	{
+		#summon_doomguard,if=talent.demonic_servitude.enabled&active_enemies<5
+		if Talent(demonic_servitude_talent) and Enemies() < 5 Spell(summon_doomguard)
+		#summon_infernal,if=talent.demonic_servitude.enabled&active_enemies>=5
+		if Talent(demonic_servitude_talent) and Enemies() >= 5 Spell(summon_infernal)
+
+		unless Talent(grimoire_of_service_talent) and Spell(grimoire_felhunter)
+		{
+			#potion,name=draenic_intellect
+			UsePotionIntellect()
+		}
+	}
+}
+
+### actions.single_target
+
+AddFunction DestructionSingleTargetMainActions
 {
-	#havoc,target=2
-	if Enemies() > 1 Spell(havoc text=other)
 	#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)
-	#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)
 	#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
 	if BuffRemaining(havoc_buff) > CastTime(chaos_bolt) and BuffStacks(havoc_buff) >= 3 Spell(chaos_bolt)
 	#conflagrate,if=charges=2
 	if Charges(conflagrate) == 2 Spell(conflagrate)
-	#cataclysm
-	Spell(cataclysm)
 	#rain_of_fire,if=remains<=tick_time&(active_enemies>4|(buff.mannoroths_fury.up&active_enemies>2))
 	if target.DebuffRemaining(rain_of_fire_debuff) <= target.TickTime(rain_of_fire_debuff) and { Enemies() > 4 or BuffPresent(mannoroths_fury_buff) and Enemies() > 2 } Spell(rain_of_fire)
 	#chaos_bolt,if=talent.charred_remains.enabled&active_enemies>1&target.health.pct>20
@@ -144,8 +191,6 @@ AddFunction DestructionSingleTargetActions
 	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
@@ -154,16 +199,73 @@ AddFunction DestructionSingleTargetActions
 	Spell(incinerate)
 }

+AddFunction DestructionSingleTargetShortCdActions
+{
+	#havoc,target=2
+	if Enemies() > 1 Spell(havoc text=other)
+
+	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)
+		{
+			#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)
+			}
+		}
+	}
+}
+
+### Destruction icons.
+AddCheckBox(opt_warlock_destruction_aoe L(AOE) specialization=destruction default)
+
+AddIcon specialization=destruction help=shortcd enemies=1 checkbox=!opt_warlock_destruction_aoe
+{
+	if not InCombat() DestructionPrecombatShortCdActions()
+	DestructionDefaultShortCdActions()
+}
+
+AddIcon specialization=destruction help=shortcd checkbox=opt_warlock_destruction_aoe
+{
+	if not InCombat() DestructionPrecombatShortCdActions()
+	DestructionDefaultShortCdActions()
+}
+
 AddIcon specialization=destruction help=main enemies=1
 {
-	if not InCombat() DestructionPrecombatActions()
-	DestructionDefaultActions()
+	if not InCombat() DestructionPrecombatMainActions()
+	DestructionDefaultMainActions()
+}
+
+AddIcon specialization=destruction help=aoe checkbox=opt_warlock_destruction_aoe
+{
+	if not InCombat() DestructionPrecombatMainActions()
+	DestructionDefaultMainActions()
+}
+
+AddIcon specialization=destruction help=cd enemies=1 checkbox=!opt_warlock_destruction_aoe
+{
+	if not InCombat() DestructionPrecombatCdActions()
+	DestructionDefaultCdActions()
 }

-AddIcon specialization=destruction help=aoe
+AddIcon specialization=destruction help=cd checkbox=opt_warlock_destruction_aoe
 {
-	if not InCombat() DestructionPrecombatActions()
-	DestructionDefaultActions()
+	if not InCombat() DestructionPrecombatCdActions()
+	DestructionDefaultCdActions()
 }

 ### Required symbols
@@ -196,6 +298,7 @@ AddIcon specialization=destruction help=aoe
 # immolate
 # immolate_debuff
 # incinerate
+# kiljaedens_cunning
 # mannoroths_fury
 # mannoroths_fury_buff
 # rain_of_fire
diff --git a/scripts/simulationcraft_warrior_arms.lua b/scripts/simulationcraft_warrior_arms.lua
index 90f5d2a..2803099 100644
--- a/scripts/simulationcraft_warrior_arms.lua
+++ b/scripts/simulationcraft_warrior_arms.lua
@@ -41,13 +41,36 @@ AddFunction InterruptActions
 	}
 }

-AddFunction ArmsDefaultActions
+### actions.default
+
+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 ArmsSingleMainActions()
+	#call_action_list,name=aoe,if=active_enemies>1
+	if Enemies() > 1 ArmsAoeMainActions()
+}
+
+AddFunction ArmsDefaultShortCdActions
 {
 	#charge
 	if target.InRange(charge) Spell(charge)
 	#auto_attack
 	#call_action_list,name=movement,if=movement.distance>5
-	if 0 > 5 ArmsMovementActions()
+	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)
+	#call_action_list,name=single,if=active_enemies=1
+	if Enemies() == 1 ArmsSingleShortCdActions()
+	#call_action_list,name=aoe,if=active_enemies>1
+	if Enemies() > 1 ArmsAoeShortCdActions()
+}
+
+AddFunction ArmsDefaultCdActions
+{
 	#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()
 	#recklessness,if=(dot.rend.ticking&(target.time_to_die>190|target.health.pct<20)&(!talent.bloodbath.enabled&(cooldown.colossus_smash.remains<2|debuff.colossus_smash.remains>=5)|buff.bloodbath.up))|target.time_to_die<10
@@ -62,24 +85,16 @@ AddFunction ArmsDefaultActions
 	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)
-	#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)
-	#call_action_list,name=single,if=active_enemies=1
-	if Enemies() == 1 ArmsSingleActions()
-	#call_action_list,name=aoe,if=active_enemies>1
-	if Enemies() > 1 ArmsAoeActions()
 }

-AddFunction ArmsAoeActions
+### actions.aoe
+
+AddFunction ArmsAoeMainActions
 {
 	#sweeping_strikes
 	Spell(sweeping_strikes)
 	#rend,if=ticks_remain<2&target.time_to_die>4
 	if target.TicksRemaining(rend_debuff) < 2 and target.TimeToDie() > 4 Spell(rend)
-	#ravager,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(ravager)
-	#bladestorm
-	Spell(bladestorm)
 	#colossus_smash,if=dot.rend.ticking
 	if target.DebuffPresent(rend_debuff) Spell(colossus_smash)
 	#mortal_strike,if=cooldown.colossus_smash.remains>1.5&target.health.pct>20&active_enemies=2
@@ -87,61 +102,87 @@ AddFunction ArmsAoeActions
 	#execute,target=2,if=active_enemies=2
 	#execute,if=((rage>60|active_enemies=2)&cooldown.colossus_smash.remains>execute_time)|debuff.colossus_smash.up|target.time_to_die<5
 	if { Rage() > 60 or Enemies() == 2 } and SpellCooldown(colossus_smash) > ExecuteTime(execute_arms) or target.DebuffPresent(colossus_smash_debuff) or target.TimeToDie() < 5 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)
 	#whirlwind,if=cooldown.colossus_smash.remains>1.5&(target.health.pct>20|active_enemies>3)
 	if SpellCooldown(colossus_smash) > 1.5 and { target.HealthPercent() > 20 or Enemies() > 3 } Spell(whirlwind)
 	#rend,cycle_targets=1,if=!ticking&target.time_to_die>8
 	if not target.DebuffPresent(rend_debuff) and target.TimeToDie() > 8 Spell(rend)
-	#siegebreaker
-	Spell(siegebreaker)
-	#storm_bolt,if=cooldown.colossus_smash.remains>4|debuff.colossus_smash.up
-	if SpellCooldown(colossus_smash) > 4 or target.DebuffPresent(colossus_smash_debuff) Spell(storm_bolt)
-	#shockwave
-	Spell(shockwave)
 	#execute,if=buff.sudden_death.react
 	if BuffPresent(sudden_death_buff) Spell(execute_arms)
 }

-AddFunction ArmsMovementActions
+AddFunction ArmsAoeShortCdActions
+{
+	unless target.TicksRemaining(rend_debuff) < 2 and target.TimeToDie() > 4 and Spell(rend)
+	{
+		#ravager,if=buff.bloodbath.up|!talent.bloodbath.enabled
+		if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(ravager)
+		#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)
+		{
+			#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)
+			{
+				#siegebreaker
+				Spell(siegebreaker)
+				#storm_bolt,if=cooldown.colossus_smash.remains>4|debuff.colossus_smash.up
+				if SpellCooldown(colossus_smash) > 4 or target.DebuffPresent(colossus_smash_debuff) Spell(storm_bolt)
+				#shockwave
+				Spell(shockwave)
+			}
+		}
+	}
+}
+
+### 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)
-	#heroic_throw
-	Spell(heroic_throw)
 }

-AddFunction ArmsPrecombatActions
+### actions.precombat
+
+AddFunction ArmsPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=blackrock_barbecue
 	#stance,choose=battle
 	Spell(battle_stance)
-	#snapshot_stats
-	#potion,name=draenic_strength
-	UsePotionStrength()
 }

-AddFunction ArmsSingleActions
+AddFunction ArmsPrecombatCdActions
+{
+	unless Spell(battle_stance)
+	{
+		#snapshot_stats
+		#potion,name=draenic_strength
+		UsePotionStrength()
+	}
+}
+
+### actions.single
+
+AddFunction ArmsSingleMainActions
 {
 	#rend,if=!ticking&target.time_to_die>4
 	if not target.DebuffPresent(rend_debuff) and target.TimeToDie() > 4 Spell(rend)
-	#ravager,if=cooldown.colossus_smash.remains<4
-	if SpellCooldown(colossus_smash) < 4 Spell(ravager)
 	#colossus_smash
 	Spell(colossus_smash)
-	#bladestorm,if=!raid_event.adds.exists&debuff.colossus_smash.up&rage<70
-	if not False(raid_event_adds_exists) and target.DebuffPresent(colossus_smash_debuff) and Rage() < 70 Spell(bladestorm)
 	#mortal_strike,if=target.health.pct>20&cooldown.colossus_smash.remains>1
 	if target.HealthPercent() > 20 and SpellCooldown(colossus_smash) > 1 Spell(mortal_strike)
-	#storm_bolt,if=(cooldown.colossus_smash.remains>4|debuff.colossus_smash.up)&rage<90
-	if { SpellCooldown(colossus_smash) > 4 or target.DebuffPresent(colossus_smash_debuff) } and Rage() < 90 Spell(storm_bolt)
-	#siegebreaker
-	Spell(siegebreaker)
-	#dragon_roar,if=!debuff.colossus_smash.up
-	if not target.DebuffPresent(colossus_smash_debuff) Spell(dragon_roar)
 	#rend,if=!debuff.colossus_smash.up&target.time_to_die>4&remains<5.4
 	if not target.DebuffPresent(colossus_smash_debuff) and target.TimeToDie() > 4 and target.DebuffRemaining(rend_debuff) < 5.4 Spell(rend)
 	#execute,if=(rage>=60&cooldown.colossus_smash.remains>execute_time)|debuff.colossus_smash.up|buff.sudden_death.react|target.time_to_die<5
@@ -152,20 +193,74 @@ AddFunction ArmsSingleActions
 	if { Rage() > 20 or SpellCooldown(colossus_smash) > ExecuteTime(slam) } and target.HealthPercent() > 20 and SpellCooldown(colossus_smash) > 1 and SpellCooldown(mortal_strike) > 1 Spell(slam)
 	#whirlwind,if=!talent.slam.enabled&target.health.pct>20&(rage>=40|set_bonus.tier17_4pc|debuff.colossus_smash.up)&cooldown.colossus_smash.remains>1&cooldown.mortal_strike.remains>1
 	if 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 Spell(whirlwind)
-	#shockwave
-	Spell(shockwave)
+}
+
+AddFunction ArmsSingleShortCdActions
+{
+	unless not target.DebuffPresent(rend_debuff) and target.TimeToDie() > 4 and Spell(rend)
+	{
+		#ravager,if=cooldown.colossus_smash.remains<4
+		if SpellCooldown(colossus_smash) < 4 Spell(ravager)
+
+		unless Spell(colossus_smash)
+		{
+			#bladestorm,if=!raid_event.adds.exists&debuff.colossus_smash.up&rage<70
+			if not False(raid_event_adds_exists) and target.DebuffPresent(colossus_smash_debuff) and Rage() < 70 Spell(bladestorm)
+
+			unless target.HealthPercent() > 20 and SpellCooldown(colossus_smash) > 1 and Spell(mortal_strike)
+			{
+				#storm_bolt,if=(cooldown.colossus_smash.remains>4|debuff.colossus_smash.up)&rage<90
+				if { SpellCooldown(colossus_smash) > 4 or target.DebuffPresent(colossus_smash_debuff) } and Rage() < 90 Spell(storm_bolt)
+				#siegebreaker
+				Spell(siegebreaker)
+				#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 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)
+				}
+			}
+		}
+	}
+}
+
+### Arms icons.
+AddCheckBox(opt_warrior_arms_aoe L(AOE) specialization=arms default)
+
+AddIcon specialization=arms help=shortcd enemies=1 checkbox=!opt_warrior_arms_aoe
+{
+	ArmsDefaultShortCdActions()
+}
+
+AddIcon specialization=arms help=shortcd checkbox=opt_warrior_arms_aoe
+{
+	ArmsDefaultShortCdActions()
 }

 AddIcon specialization=arms help=main enemies=1
 {
-	if not InCombat() ArmsPrecombatActions()
-	ArmsDefaultActions()
+	if not InCombat() ArmsPrecombatMainActions()
+	ArmsDefaultMainActions()
+}
+
+AddIcon specialization=arms help=aoe checkbox=opt_warrior_arms_aoe
+{
+	if not InCombat() ArmsPrecombatMainActions()
+	ArmsDefaultMainActions()
+}
+
+AddIcon specialization=arms help=cd enemies=1 checkbox=!opt_warrior_arms_aoe
+{
+	if not InCombat() ArmsPrecombatCdActions()
+	ArmsDefaultCdActions()
 }

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

 ### Required symbols
diff --git a/scripts/simulationcraft_warrior_fury_1h.lua b/scripts/simulationcraft_warrior_fury_1h.lua
index d2fd0a4..64e404a 100644
--- a/scripts/simulationcraft_warrior_fury_1h.lua
+++ b/scripts/simulationcraft_warrior_fury_1h.lua
@@ -41,21 +41,54 @@ AddFunction InterruptActions
 	}
 }

-AddFunction FurySingleMindedFuryDefaultActions
+### actions.default
+
+AddFunction FurySingleMindedFuryDefaultMainActions
+{
+	#auto_attack
+	#call_action_list,name=movement,if=movement.distance>5
+	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 FurySingleMindedFurySingleTargetMainActions()
+	#call_action_list,name=single_target,if=active_enemies=1
+	if Enemies() == 1 FurySingleMindedFurySingleTargetMainActions()
+	#call_action_list,name=two_targets,if=active_enemies=2
+	if Enemies() == 2 FurySingleMindedFuryTwoTargetsMainActions()
+	#call_action_list,name=three_targets,if=active_enemies=3
+	if Enemies() == 3 FurySingleMindedFuryThreeTargetsMainActions()
+	#call_action_list,name=aoe,if=active_enemies>3
+	if Enemies() > 3 FurySingleMindedFuryAoeMainActions()
+}
+
+AddFunction FurySingleMindedFuryDefaultShortCdActions
 {
 	#charge
 	if target.InRange(charge) Spell(charge)
 	#auto_attack
 	#call_action_list,name=movement,if=movement.distance>5
-	if 0 > 5 FurySingleMindedFuryMovementActions()
+	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)
+	#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
+	if Enemies() == 1 FurySingleMindedFurySingleTargetShortCdActions()
+	#call_action_list,name=two_targets,if=active_enemies=2
+	if Enemies() == 2 FurySingleMindedFuryTwoTargetsShortCdActions()
+	#call_action_list,name=three_targets,if=active_enemies=3
+	if Enemies() == 3 FurySingleMindedFuryThreeTargetsShortCdActions()
+	#call_action_list,name=aoe,if=active_enemies>3
+	if Enemies() > 3 FurySingleMindedFuryAoeShortCdActions()
+}
+
+AddFunction FurySingleMindedFuryDefaultCdActions
+{
 	#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
-	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 FurySingleMindedFurySingleTargetCdActions()
 	#recklessness,if=((target.time_to_die>190|target.health.pct<20)&(buff.bloodbath.up|!talent.bloodbath.enabled))|target.time_to_die<=12|talent.anger_management.enabled
 	if { target.TimeToDie() > 190 or target.HealthPercent() < 20 } and { BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) } or target.TimeToDie() <= 12 or Talent(anger_management_talent) Spell(recklessness)
 	#avatar,if=(buff.recklessness.up|target.time_to_die<=30)
@@ -67,120 +100,174 @@ AddFunction FurySingleMindedFuryDefaultActions
 	#arcane_torrent,if=rage<rage.max-40
 	if Rage() < MaxRage() - 40 Spell(arcane_torrent_rage)
 	#call_action_list,name=single_target,if=active_enemies=1
-	if Enemies() == 1 FurySingleMindedFurySingleTargetActions()
+	if Enemies() == 1 FurySingleMindedFurySingleTargetCdActions()
 	#call_action_list,name=two_targets,if=active_enemies=2
-	if Enemies() == 2 FurySingleMindedFuryTwoTargetsActions()
+	if Enemies() == 2 FurySingleMindedFuryTwoTargetsCdActions()
 	#call_action_list,name=three_targets,if=active_enemies=3
-	if Enemies() == 3 FurySingleMindedFuryThreeTargetsActions()
+	if Enemies() == 3 FurySingleMindedFuryThreeTargetsCdActions()
 	#call_action_list,name=aoe,if=active_enemies>3
-	if Enemies() > 3 FurySingleMindedFuryAoeActions()
+	if Enemies() > 3 FurySingleMindedFuryAoeCdActions()
 }

-AddFunction FurySingleMindedFuryAoeActions
+### actions.aoe
+
+AddFunction FurySingleMindedFuryAoeMainActions
 {
-	#bloodbath
-	Spell(bloodbath)
-	#ravager,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(ravager)
 	#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)
 	#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)
 	#raging_blow,if=buff.meat_cleaver.stack>=3
 	if BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(raging_blow_buff) Spell(raging_blow)
-	#recklessness,sync=bladestorm
-	if not SpellCooldown(bladestorm) > 0 Spell(recklessness)
-	#bladestorm,if=buff.enrage.remains>6
-	if BuffRemaining(enrage_buff any=1) > 6 Spell(bladestorm)
 	#whirlwind
 	Spell(whirlwind)
 	#execute,if=buff.sudden_death.react
 	if BuffPresent(sudden_death_buff) Spell(execute)
-	#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
 	#bloodthirst
 	Spell(bloodthirst)
 	#wild_strike,if=buff.bloodsurge.up
 	if BuffPresent(bloodsurge_buff) Spell(wild_strike)
 }

-AddFunction FurySingleMindedFuryMovementActions
+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)
+	{
+		#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)
+		{
+			#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
+			if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
+		}
+	}
+}
+
+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)
+	{
+		#recklessness,sync=bladestorm
+		if not SpellCooldown(bladestorm) > 0 Spell(recklessness)
+	}
+}
+
+### actions.movement
+
+AddFunction FurySingleMindedFuryMovementMainActions
+{
+	#heroic_throw
+	Spell(heroic_throw)
+}
+
+AddFunction FurySingleMindedFuryMovementShortCdActions
 {
 	#heroic_leap
 	if target.InRange(charge) Spell(heroic_leap)
 	#storm_bolt
 	Spell(storm_bolt)
-	#heroic_throw
-	Spell(heroic_throw)
 }

-AddFunction FurySingleMindedFuryPrecombatActions
+### actions.precombat
+
+AddFunction FurySingleMindedFuryPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=blackrock_barbecue
 	#stance,choose=battle
 	Spell(battle_stance)
-	#snapshot_stats
-	#potion,name=draenic_strength
-	UsePotionStrength()
 }

-AddFunction FurySingleMindedFurySingleTargetActions
+AddFunction FurySingleMindedFuryPrecombatCdActions
+{
+	unless Spell(battle_stance)
+	{
+		#snapshot_stats
+		#potion,name=draenic_strength
+		UsePotionStrength()
+	}
+}
+
+### actions.single_target
+
+AddFunction FurySingleMindedFurySingleTargetMainActions
 {
-	#bloodbath
-	Spell(bloodbath)
-	#recklessness,if=target.health.pct<20&raid_event.adds.exists
-	if target.HealthPercent() < 20 and False(raid_event_adds_exists) Spell(recklessness)
 	#wild_strike,if=rage>110&target.health.pct>20
 	if Rage() > 110 and target.HealthPercent() > 20 Spell(wild_strike)
 	#bloodthirst,if=(!talent.unquenchable_thirst.enabled&rage<80)|buff.enrage.down
 	if not Talent(unquenchable_thirst_talent) and Rage() < 80 or BuffExpires(enrage_buff any=1) 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)
 	#execute,if=buff.sudden_death.react
 	if BuffPresent(sudden_death_buff) Spell(execute)
-	#siegebreaker
-	Spell(siegebreaker)
-	#storm_bolt
-	Spell(storm_bolt)
 	#wild_strike,if=buff.bloodsurge.up
 	if BuffPresent(bloodsurge_buff) Spell(wild_strike)
 	#execute,if=buff.enrage.up|target.time_to_die<12
 	if BuffPresent(enrage_buff any=1) or target.TimeToDie() < 12 Spell(execute)
-	#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
 	#raging_blow
 	if BuffPresent(raging_blow_buff) Spell(raging_blow)
 	#wild_strike,if=buff.enrage.up&target.health.pct>20
 	if BuffPresent(enrage_buff any=1) and target.HealthPercent() > 20 Spell(wild_strike)
-	#bladestorm,if=!raid_event.adds.exists
-	if not False(raid_event_adds_exists) Spell(bladestorm)
-	#shockwave,if=!talent.unquenchable_thirst.enabled
-	if not Talent(unquenchable_thirst_talent) Spell(shockwave)
 	#impending_victory,if=!talent.unquenchable_thirst.enabled&target.health.pct>20
 	if not Talent(unquenchable_thirst_talent) and target.HealthPercent() > 20 Spell(impending_victory)
 	#bloodthirst
 	Spell(bloodthirst)
 }

-AddFunction FurySingleMindedFuryThreeTargetsActions
+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)
+	{
+		#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)
+
+		unless BuffPresent(sudden_death_buff) and Spell(execute)
+		{
+			#siegebreaker
+			Spell(siegebreaker)
+			#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)
+			{
+				#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)
+				{
+					#bladestorm,if=!raid_event.adds.exists
+					if not False(raid_event_adds_exists) Spell(bladestorm)
+					#shockwave,if=!talent.unquenchable_thirst.enabled
+					if not Talent(unquenchable_thirst_talent) Spell(shockwave)
+				}
+			}
+		}
+	}
+}
+
+AddFunction FurySingleMindedFurySingleTargetCdActions
 {
 	#bloodbath
 	Spell(bloodbath)
-	#ravager,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(ravager)
-	#bladestorm,if=buff.enrage.up
-	if BuffPresent(enrage_buff any=1) Spell(bladestorm)
+	#recklessness,if=target.health.pct<20&raid_event.adds.exists
+	if target.HealthPercent() < 20 and False(raid_event_adds_exists) Spell(recklessness)
+}
+
+### actions.three_targets
+
+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)
 	#raging_blow,if=buff.meat_cleaver.stack>=2
 	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
-	#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
 	#whirlwind
 	Spell(whirlwind)
 	#bloodthirst
@@ -189,16 +276,32 @@ AddFunction FurySingleMindedFuryThreeTargetsActions
 	if BuffPresent(bloodsurge_buff) Spell(wild_strike)
 }

-AddFunction FurySingleMindedFuryTwoTargetsActions
+AddFunction FurySingleMindedFuryThreeTargetsShortCdActions
 {
-	#bloodbath
-	Spell(bloodbath)
 	#ravager,if=buff.bloodbath.up|!talent.bloodbath.enabled
 	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(ravager)
-	#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
 	#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)
+	{
+		#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)
+	}
+}
+
+AddFunction FurySingleMindedFuryThreeTargetsCdActions
+{
+	#bloodbath
+	Spell(bloodbath)
+}
+
+### actions.two_targets
+
+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)
 	#execute,target=2
@@ -218,16 +321,57 @@ AddFunction FurySingleMindedFuryTwoTargetsActions
 	if BuffPresent(bloodsurge_buff) Spell(wild_strike)
 }

+AddFunction FurySingleMindedFuryTwoTargetsShortCdActions
+{
+	#ravager,if=buff.bloodbath.up|!talent.bloodbath.enabled
+	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(ravager)
+	#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
+	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
+	#bladestorm,if=buff.enrage.up
+	if BuffPresent(enrage_buff any=1) Spell(bladestorm)
+}
+
+AddFunction FurySingleMindedFuryTwoTargetsCdActions
+{
+	#bloodbath
+	Spell(bloodbath)
+}
+
+### Fury icons.
+AddCheckBox(opt_warrior_fury_aoe L(AOE) specialization=fury default)
+
+AddIcon specialization=fury help=shortcd enemies=1 checkbox=!opt_warrior_fury_aoe
+{
+	FurySingleMindedFuryDefaultShortCdActions()
+}
+
+AddIcon specialization=fury help=shortcd checkbox=opt_warrior_fury_aoe
+{
+	FurySingleMindedFuryDefaultShortCdActions()
+}
+
 AddIcon specialization=fury help=main enemies=1
 {
-	if not InCombat() FurySingleMindedFuryPrecombatActions()
-	FurySingleMindedFuryDefaultActions()
+	if not InCombat() FurySingleMindedFuryPrecombatMainActions()
+	FurySingleMindedFuryDefaultMainActions()
+}
+
+AddIcon specialization=fury help=aoe checkbox=opt_warrior_fury_aoe
+{
+	if not InCombat() FurySingleMindedFuryPrecombatMainActions()
+	FurySingleMindedFuryDefaultMainActions()
+}
+
+AddIcon specialization=fury help=cd enemies=1 checkbox=!opt_warrior_fury_aoe
+{
+	if not InCombat() FurySingleMindedFuryPrecombatCdActions()
+	FurySingleMindedFuryDefaultCdActions()
 }

-AddIcon specialization=fury help=aoe
+AddIcon specialization=fury help=cd checkbox=opt_warrior_fury_aoe
 {
-	if not InCombat() FurySingleMindedFuryPrecombatActions()
-	FurySingleMindedFuryDefaultActions()
+	if not InCombat() FurySingleMindedFuryPrecombatCdActions()
+	FurySingleMindedFuryDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_warrior_fury_2h.lua b/scripts/simulationcraft_warrior_fury_2h.lua
index d38623f..5f9674f 100644
--- a/scripts/simulationcraft_warrior_fury_2h.lua
+++ b/scripts/simulationcraft_warrior_fury_2h.lua
@@ -41,21 +41,54 @@ AddFunction InterruptActions
 	}
 }

-AddFunction FuryTitansGripDefaultActions
+### actions.default
+
+AddFunction FuryTitansGripDefaultMainActions
+{
+	#auto_attack
+	#call_action_list,name=movement,if=movement.distance>5
+	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 FuryTitansGripSingleTargetMainActions()
+	#call_action_list,name=single_target,if=active_enemies=1
+	if Enemies() == 1 FuryTitansGripSingleTargetMainActions()
+	#call_action_list,name=two_targets,if=active_enemies=2
+	if Enemies() == 2 FuryTitansGripTwoTargetsMainActions()
+	#call_action_list,name=three_targets,if=active_enemies=3
+	if Enemies() == 3 FuryTitansGripThreeTargetsMainActions()
+	#call_action_list,name=aoe,if=active_enemies>3
+	if Enemies() > 3 FuryTitansGripAoeMainActions()
+}
+
+AddFunction FuryTitansGripDefaultShortCdActions
 {
 	#charge
 	if target.InRange(charge) Spell(charge)
 	#auto_attack
 	#call_action_list,name=movement,if=movement.distance>5
-	if 0 > 5 FuryTitansGripMovementActions()
+	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)
+	#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
+	if Enemies() == 1 FuryTitansGripSingleTargetShortCdActions()
+	#call_action_list,name=two_targets,if=active_enemies=2
+	if Enemies() == 2 FuryTitansGripTwoTargetsShortCdActions()
+	#call_action_list,name=three_targets,if=active_enemies=3
+	if Enemies() == 3 FuryTitansGripThreeTargetsShortCdActions()
+	#call_action_list,name=aoe,if=active_enemies>3
+	if Enemies() > 3 FuryTitansGripAoeShortCdActions()
+}
+
+AddFunction FuryTitansGripDefaultCdActions
+{
 	#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
-	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 FuryTitansGripSingleTargetCdActions()
 	#recklessness,if=((target.time_to_die>190|target.health.pct<20)&(buff.bloodbath.up|!talent.bloodbath.enabled))|target.time_to_die<=12|talent.anger_management.enabled
 	if { target.TimeToDie() > 190 or target.HealthPercent() < 20 } and { BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) } or target.TimeToDie() <= 12 or Talent(anger_management_talent) Spell(recklessness)
 	#avatar,if=(buff.recklessness.up|target.time_to_die<=30)
@@ -67,120 +100,174 @@ AddFunction FuryTitansGripDefaultActions
 	#arcane_torrent,if=rage<rage.max-40
 	if Rage() < MaxRage() - 40 Spell(arcane_torrent_rage)
 	#call_action_list,name=single_target,if=active_enemies=1
-	if Enemies() == 1 FuryTitansGripSingleTargetActions()
+	if Enemies() == 1 FuryTitansGripSingleTargetCdActions()
 	#call_action_list,name=two_targets,if=active_enemies=2
-	if Enemies() == 2 FuryTitansGripTwoTargetsActions()
+	if Enemies() == 2 FuryTitansGripTwoTargetsCdActions()
 	#call_action_list,name=three_targets,if=active_enemies=3
-	if Enemies() == 3 FuryTitansGripThreeTargetsActions()
+	if Enemies() == 3 FuryTitansGripThreeTargetsCdActions()
 	#call_action_list,name=aoe,if=active_enemies>3
-	if Enemies() > 3 FuryTitansGripAoeActions()
+	if Enemies() > 3 FuryTitansGripAoeCdActions()
 }

-AddFunction FuryTitansGripAoeActions
+### actions.aoe
+
+AddFunction FuryTitansGripAoeMainActions
 {
-	#bloodbath
-	Spell(bloodbath)
-	#ravager,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(ravager)
 	#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)
 	#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)
 	#raging_blow,if=buff.meat_cleaver.stack>=3
 	if BuffStacks(meat_cleaver_buff) >= 3 and BuffPresent(raging_blow_buff) Spell(raging_blow)
-	#recklessness,sync=bladestorm
-	if not SpellCooldown(bladestorm) > 0 Spell(recklessness)
-	#bladestorm,if=buff.enrage.remains>6
-	if BuffRemaining(enrage_buff any=1) > 6 Spell(bladestorm)
 	#whirlwind
 	Spell(whirlwind)
 	#execute,if=buff.sudden_death.react
 	if BuffPresent(sudden_death_buff) Spell(execute)
-	#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
 	#bloodthirst
 	Spell(bloodthirst)
 	#wild_strike,if=buff.bloodsurge.up
 	if BuffPresent(bloodsurge_buff) Spell(wild_strike)
 }

-AddFunction FuryTitansGripMovementActions
+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)
+	{
+		#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)
+		{
+			#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
+			if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
+		}
+	}
+}
+
+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)
+	{
+		#recklessness,sync=bladestorm
+		if not SpellCooldown(bladestorm) > 0 Spell(recklessness)
+	}
+}
+
+### actions.movement
+
+AddFunction FuryTitansGripMovementMainActions
+{
+	#heroic_throw
+	Spell(heroic_throw)
+}
+
+AddFunction FuryTitansGripMovementShortCdActions
 {
 	#heroic_leap
 	if target.InRange(charge) Spell(heroic_leap)
 	#storm_bolt
 	Spell(storm_bolt)
-	#heroic_throw
-	Spell(heroic_throw)
 }

-AddFunction FuryTitansGripPrecombatActions
+### actions.precombat
+
+AddFunction FuryTitansGripPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=blackrock_barbecue
 	#stance,choose=battle
 	Spell(battle_stance)
-	#snapshot_stats
-	#potion,name=draenic_strength
-	UsePotionStrength()
 }

-AddFunction FuryTitansGripSingleTargetActions
+AddFunction FuryTitansGripPrecombatCdActions
+{
+	unless Spell(battle_stance)
+	{
+		#snapshot_stats
+		#potion,name=draenic_strength
+		UsePotionStrength()
+	}
+}
+
+### actions.single_target
+
+AddFunction FuryTitansGripSingleTargetMainActions
 {
-	#bloodbath
-	Spell(bloodbath)
-	#recklessness,if=target.health.pct<20&raid_event.adds.exists
-	if target.HealthPercent() < 20 and False(raid_event_adds_exists) Spell(recklessness)
 	#wild_strike,if=rage>110&target.health.pct>20
 	if Rage() > 110 and target.HealthPercent() > 20 Spell(wild_strike)
 	#bloodthirst,if=(!talent.unquenchable_thirst.enabled&rage<80)|buff.enrage.down
 	if not Talent(unquenchable_thirst_talent) and Rage() < 80 or BuffExpires(enrage_buff any=1) 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)
 	#execute,if=buff.sudden_death.react
 	if BuffPresent(sudden_death_buff) Spell(execute)
-	#siegebreaker
-	Spell(siegebreaker)
-	#storm_bolt
-	Spell(storm_bolt)
 	#wild_strike,if=buff.bloodsurge.up
 	if BuffPresent(bloodsurge_buff) Spell(wild_strike)
 	#execute,if=buff.enrage.up|target.time_to_die<12
 	if BuffPresent(enrage_buff any=1) or target.TimeToDie() < 12 Spell(execute)
-	#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
 	#raging_blow
 	if BuffPresent(raging_blow_buff) Spell(raging_blow)
 	#wild_strike,if=buff.enrage.up&target.health.pct>20
 	if BuffPresent(enrage_buff any=1) and target.HealthPercent() > 20 Spell(wild_strike)
-	#bladestorm,if=!raid_event.adds.exists
-	if not False(raid_event_adds_exists) Spell(bladestorm)
-	#shockwave,if=!talent.unquenchable_thirst.enabled
-	if not Talent(unquenchable_thirst_talent) Spell(shockwave)
 	#impending_victory,if=!talent.unquenchable_thirst.enabled&target.health.pct>20
 	if not Talent(unquenchable_thirst_talent) and target.HealthPercent() > 20 Spell(impending_victory)
 	#bloodthirst
 	Spell(bloodthirst)
 }

-AddFunction FuryTitansGripThreeTargetsActions
+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)
+	{
+		#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)
+
+		unless BuffPresent(sudden_death_buff) and Spell(execute)
+		{
+			#siegebreaker
+			Spell(siegebreaker)
+			#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)
+			{
+				#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)
+				{
+					#bladestorm,if=!raid_event.adds.exists
+					if not False(raid_event_adds_exists) Spell(bladestorm)
+					#shockwave,if=!talent.unquenchable_thirst.enabled
+					if not Talent(unquenchable_thirst_talent) Spell(shockwave)
+				}
+			}
+		}
+	}
+}
+
+AddFunction FuryTitansGripSingleTargetCdActions
 {
 	#bloodbath
 	Spell(bloodbath)
-	#ravager,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(ravager)
-	#bladestorm,if=buff.enrage.up
-	if BuffPresent(enrage_buff any=1) Spell(bladestorm)
+	#recklessness,if=target.health.pct<20&raid_event.adds.exists
+	if target.HealthPercent() < 20 and False(raid_event_adds_exists) Spell(recklessness)
+}
+
+### actions.three_targets
+
+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)
 	#raging_blow,if=buff.meat_cleaver.stack>=2
 	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
-	#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
 	#whirlwind
 	Spell(whirlwind)
 	#bloodthirst
@@ -189,16 +276,32 @@ AddFunction FuryTitansGripThreeTargetsActions
 	if BuffPresent(bloodsurge_buff) Spell(wild_strike)
 }

-AddFunction FuryTitansGripTwoTargetsActions
+AddFunction FuryTitansGripThreeTargetsShortCdActions
 {
-	#bloodbath
-	Spell(bloodbath)
 	#ravager,if=buff.bloodbath.up|!talent.bloodbath.enabled
 	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(ravager)
-	#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
-	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
 	#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)
+	{
+		#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)
+	}
+}
+
+AddFunction FuryTitansGripThreeTargetsCdActions
+{
+	#bloodbath
+	Spell(bloodbath)
+}
+
+### actions.two_targets
+
+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)
 	#execute,target=2
@@ -218,16 +321,57 @@ AddFunction FuryTitansGripTwoTargetsActions
 	if BuffPresent(bloodsurge_buff) Spell(wild_strike)
 }

+AddFunction FuryTitansGripTwoTargetsShortCdActions
+{
+	#ravager,if=buff.bloodbath.up|!talent.bloodbath.enabled
+	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(ravager)
+	#dragon_roar,if=buff.bloodbath.up|!talent.bloodbath.enabled
+	if BuffPresent(bloodbath_buff) or not Talent(bloodbath_talent) Spell(dragon_roar)
+	#bladestorm,if=buff.enrage.up
+	if BuffPresent(enrage_buff any=1) Spell(bladestorm)
+}
+
+AddFunction FuryTitansGripTwoTargetsCdActions
+{
+	#bloodbath
+	Spell(bloodbath)
+}
+
+### Fury icons.
+AddCheckBox(opt_warrior_fury_aoe L(AOE) specialization=fury default)
+
+AddIcon specialization=fury help=shortcd enemies=1 checkbox=!opt_warrior_fury_aoe
+{
+	FuryTitansGripDefaultShortCdActions()
+}
+
+AddIcon specialization=fury help=shortcd checkbox=opt_warrior_fury_aoe
+{
+	FuryTitansGripDefaultShortCdActions()
+}
+
 AddIcon specialization=fury help=main enemies=1
 {
-	if not InCombat() FuryTitansGripPrecombatActions()
-	FuryTitansGripDefaultActions()
+	if not InCombat() FuryTitansGripPrecombatMainActions()
+	FuryTitansGripDefaultMainActions()
+}
+
+AddIcon specialization=fury help=aoe checkbox=opt_warrior_fury_aoe
+{
+	if not InCombat() FuryTitansGripPrecombatMainActions()
+	FuryTitansGripDefaultMainActions()
+}
+
+AddIcon specialization=fury help=cd enemies=1 checkbox=!opt_warrior_fury_aoe
+{
+	if not InCombat() FuryTitansGripPrecombatCdActions()
+	FuryTitansGripDefaultCdActions()
 }

-AddIcon specialization=fury help=aoe
+AddIcon specialization=fury help=cd checkbox=opt_warrior_fury_aoe
 {
-	if not InCombat() FuryTitansGripPrecombatActions()
-	FuryTitansGripDefaultActions()
+	if not InCombat() FuryTitansGripPrecombatCdActions()
+	FuryTitansGripDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_warrior_gladiator.lua b/scripts/simulationcraft_warrior_gladiator.lua
index 4664fe7..7cb8027 100644
--- a/scripts/simulationcraft_warrior_gladiator.lua
+++ b/scripts/simulationcraft_warrior_gladiator.lua
@@ -41,25 +41,26 @@ AddFunction InterruptActions
 	}
 }

-AddFunction ProtectionGladiatorDefaultActions
+### 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 ProtectionGladiatorMovementActions()
-	#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()
+	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
@@ -71,25 +72,37 @@ AddFunction ProtectionGladiatorDefaultActions
 	#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 ProtectionGladiatorSingleActions()
+	if Enemies() == 1 ProtectionGladiatorSingleShortCdActions()
 	#call_action_list,name=aoe,if=active_enemies>=2
-	if Enemies() >= 2 ProtectionGladiatorAoeActions()
+	if Enemies() >= 2 ProtectionGladiatorAoeShortCdActions()
 }

-AddFunction ProtectionGladiatorAoeActions
+AddFunction ProtectionGladiatorDefaultCdActions
+{
+	#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)
-	#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)
 	#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)
-	#bladestorm,if=buff.shield_charge.down
-	if BuffExpires(shield_charge_buff) Spell(bladestorm)
 	#execute,if=buff.sudden_death.react
 	if BuffPresent(sudden_death_buff) Spell(execute)
 	#thunder_clap,if=active_enemies>6
@@ -100,7 +113,32 @@ AddFunction ProtectionGladiatorAoeActions
 	if SpellCooldown(shield_slam) > ExecuteTime(devastate) * 0.4 Spell(devastate)
 }

-AddFunction ProtectionGladiatorMovementActions
+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)
@@ -108,22 +146,31 @@ AddFunction ProtectionGladiatorMovementActions
 	Spell(shield_charge)
 	#storm_bolt
 	Spell(storm_bolt)
-	#heroic_throw
-	Spell(heroic_throw)
 }

-AddFunction ProtectionGladiatorPrecombatActions
+### actions.precombat
+
+AddFunction ProtectionGladiatorPrecombatMainActions
 {
 	#flask,type=greater_draenic_strength_flask
 	#food,type=blackrock_barbecue
 	#stance,choose=gladiator
 	Spell(gladiator_stance)
-	#snapshot_stats
-	#potion,name=draenic_armor
-	UsePotionArmor()
 }

-AddFunction ProtectionGladiatorSingleActions
+AddFunction ProtectionGladiatorPrecombatCdActions
+{
+	unless 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)
@@ -133,26 +180,58 @@ AddFunction ProtectionGladiatorSingleActions
 	Spell(revenge)
 	#execute,if=buff.sudden_death.react
 	if BuffPresent(sudden_death_buff) Spell(execute)
-	#storm_bolt
-	Spell(storm_bolt)
-	#dragon_roar
-	Spell(dragon_roar)
 	#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 icons.
+AddCheckBox(opt_warrior_protection_aoe L(AOE) specialization=protection default)
+
+AddIcon specialization=protection help=shortcd enemies=1 checkbox=!opt_warrior_protection_aoe
+{
+	ProtectionGladiatorDefaultShortCdActions()
+}
+
+AddIcon specialization=protection help=shortcd checkbox=opt_warrior_protection_aoe
+{
+	ProtectionGladiatorDefaultShortCdActions()
+}
+
 AddIcon specialization=protection help=main enemies=1
 {
-	if not InCombat() ProtectionGladiatorPrecombatActions()
-	ProtectionGladiatorDefaultActions()
+	if not InCombat() ProtectionGladiatorPrecombatMainActions()
+	ProtectionGladiatorDefaultMainActions()
+}
+
+AddIcon specialization=protection help=aoe checkbox=opt_warrior_protection_aoe
+{
+	if not InCombat() ProtectionGladiatorPrecombatMainActions()
+	ProtectionGladiatorDefaultMainActions()
+}
+
+AddIcon specialization=protection help=cd enemies=1 checkbox=!opt_warrior_protection_aoe
+{
+	if not InCombat() ProtectionGladiatorPrecombatCdActions()
+	ProtectionGladiatorDefaultCdActions()
 }

-AddIcon specialization=protection help=aoe
+AddIcon specialization=protection help=cd checkbox=opt_warrior_protection_aoe
 {
-	if not InCombat() ProtectionGladiatorPrecombatActions()
-	ProtectionGladiatorDefaultActions()
+	if not InCombat() ProtectionGladiatorPrecombatCdActions()
+	ProtectionGladiatorDefaultCdActions()
 }

 ### Required symbols
diff --git a/scripts/simulationcraft_warrior_protection.lua b/scripts/simulationcraft_warrior_protection.lua
index 6d52271..4d6b006 100644
--- a/scripts/simulationcraft_warrior_protection.lua
+++ b/scripts/simulationcraft_warrior_protection.lua
@@ -41,10 +41,26 @@ AddFunction InterruptActions
 	}
 }

-AddFunction ProtectionDefaultActions
+### actions.default
+
+AddFunction ProtectionDefaultMainActions
+{
+	#call_action_list,name=prot
+	ProtectionProtMainActions()
+}
+
+AddFunction ProtectionDefaultShortCdActions
 {
 	#charge
 	if target.InRange(charge) Spell(charge)
+	#berserker_rage,if=buff.enrage.down
+	if BuffExpires(enrage_buff any=1) Spell(berserker_rage)
+	#call_action_list,name=prot
+	ProtectionProtShortCdActions()
+}
+
+AddFunction ProtectionDefaultCdActions
+{
 	#auto_attack
 	#blood_fury,if=buff.bloodbath.up|buff.avatar.up
 	if BuffPresent(bloodbath_buff) or BuffPresent(avatar_buff) Spell(blood_fury_ap)
@@ -52,26 +68,53 @@ AddFunction ProtectionDefaultActions
 	if BuffPresent(bloodbath_buff) or BuffPresent(avatar_buff) Spell(berserking)
 	#arcane_torrent,if=buff.bloodbath.up|buff.avatar.up
 	if BuffPresent(bloodbath_buff) or BuffPresent(avatar_buff) Spell(arcane_torrent_rage)
-	#berserker_rage,if=buff.enrage.down
-	if BuffExpires(enrage_buff any=1) Spell(berserker_rage)
 	#call_action_list,name=prot
-	ProtectionProtActions()
+	ProtectionProtCdActions()
 }

-AddFunction ProtectionPrecombatActions
+### actions.precombat
+
+AddFunction ProtectionPrecombatMainActions
 {
 	#flask,type=greater_draenic_stamina_flask
 	#food,type=blackrock_barbecue
 	#stance,choose=defensive
 	Spell(defensive_stance)
-	#snapshot_stats
-	#shield_wall
-	Spell(shield_wall)
-	#potion,name=draenic_armor
-	UsePotionArmor()
 }

-AddFunction ProtectionProtActions
+AddFunction ProtectionPrecombatCdActions
+{
+	unless Spell(defensive_stance)
+	{
+		#snapshot_stats
+		#shield_wall
+		Spell(shield_wall)
+		#potion,name=draenic_armor
+		UsePotionArmor()
+	}
+}
+
+### actions.prot
+
+AddFunction ProtectionProtMainActions
+{
+	#call_action_list,name=prot_aoe,if=active_enemies>3
+	if Enemies() > 3 ProtectionProtAoeMainActions()
+	#shield_slam
+	Spell(shield_slam)
+	#revenge
+	Spell(revenge)
+	#impending_victory,if=talent.impending_victory.enabled&cooldown.shield_slam.remains<=execute_time
+	if Talent(impending_victory_talent) and SpellCooldown(shield_slam) <= ExecuteTime(impending_victory) Spell(impending_victory)
+	#victory_rush,if=!talent.impending_victory.enabled&cooldown.shield_slam.remains<=execute_time
+	if not Talent(impending_victory_talent) and SpellCooldown(shield_slam) <= ExecuteTime(victory_rush) and BuffPresent(victorious_buff) Spell(victory_rush)
+	#execute,if=buff.sudden_death.react
+	if BuffPresent(sudden_death_buff) Spell(execute)
+	#devastate
+	Spell(devastate)
+}
+
+AddFunction ProtectionProtShortCdActions
 {
 	#shield_block,if=!(debuff.demoralizing_shout.up|buff.ravager.up|buff.shield_wall.up|buff.last_stand.up|buff.enraged_regeneration.up|buff.shield_block.up)
 	if 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) } Spell(shield_block)
@@ -80,7 +123,25 @@ AddFunction ProtectionProtActions
 	#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)
 	#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 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()
+	#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)
+	{
+		#ravager
+		Spell(ravager)
+		#storm_bolt
+		Spell(storm_bolt)
+		#dragon_roar
+		Spell(dragon_roar)
+	}
+}
+
+AddFunction ProtectionProtCdActions
+{
 	#shield_wall,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(shield_wall)
 	#last_stand,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)
@@ -90,63 +151,27 @@ AddFunction ProtectionProtActions
 	#stoneform,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(stoneform)
 	#call_action_list,name=prot_aoe,if=active_enemies>3
-	if Enemies() > 3 ProtectionProtAoeActions()
-	#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)
+	if Enemies() > 3 ProtectionProtAoeCdActions()
 	#bloodbath,if=talent.bloodbath.enabled&((cooldown.dragon_roar.remains=0&talent.dragon_roar.enabled)|(cooldown.storm_bolt.remains=0&talent.storm_bolt.enabled)|talent.shockwave.enabled)
 	if Talent(bloodbath_talent) and { not SpellCooldown(dragon_roar) > 0 and Talent(dragon_roar_talent) or not SpellCooldown(storm_bolt) > 0 and Talent(storm_bolt_talent) or Talent(shockwave_talent) } Spell(bloodbath)
 	#avatar,if=talent.avatar.enabled&((cooldown.ravager.remains=0&talent.ravager.enabled)|(cooldown.dragon_roar.remains=0&talent.dragon_roar.enabled)|(talent.storm_bolt.enabled&cooldown.storm_bolt.remains=0)|(!(talent.dragon_roar.enabled|talent.ravager.enabled|talent.storm_bolt.enabled)))
 	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)
-	#shield_slam
-	Spell(shield_slam)
-	#revenge
-	Spell(revenge)
-	#ravager
-	Spell(ravager)
-	#storm_bolt
-	Spell(storm_bolt)
-	#dragon_roar
-	Spell(dragon_roar)
-	#impending_victory,if=talent.impending_victory.enabled&cooldown.shield_slam.remains<=execute_time
-	if Talent(impending_victory_talent) and SpellCooldown(shield_slam) <= ExecuteTime(impending_victory) Spell(impending_victory)
-	#victory_rush,if=!talent.impending_victory.enabled&cooldown.shield_slam.remains<=execute_time
-	if not Talent(impending_victory_talent) and SpellCooldown(shield_slam) <= ExecuteTime(victory_rush) and BuffPresent(victorious_buff) Spell(victory_rush)
-	#execute,if=buff.sudden_death.react
-	if BuffPresent(sudden_death_buff) Spell(execute)
-	#devastate
-	Spell(devastate)
 }

-AddFunction ProtectionProtAoeActions
+### actions.prot_aoe
+
+AddFunction ProtectionProtAoeMainActions
 {
-	#bloodbath
-	Spell(bloodbath)
-	#avatar
-	Spell(avatar)
 	#thunder_clap,if=!dot.deep_wounds.ticking
 	if not target.DebuffPresent(deep_wounds_debuff) 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)
 	#shield_slam,if=buff.shield_block.up
 	if BuffPresent(shield_block_buff) 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)
 	#revenge
 	Spell(revenge)
 	#thunder_clap
 	Spell(thunder_clap)
-	#bladestorm
-	Spell(bladestorm)
 	#shield_slam
 	Spell(shield_slam)
-	#storm_bolt
-	Spell(storm_bolt)
 	#shield_slam
 	Spell(shield_slam)
 	#execute,if=buff.sudden_death.react
@@ -155,16 +180,82 @@ AddFunction ProtectionProtAoeActions
 	Spell(devastate)
 }

+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)
+}
+
+### Protection icons.
+AddCheckBox(opt_warrior_protection_aoe L(AOE) specialization=protection default)
+
+AddIcon specialization=protection help=shortcd enemies=1 checkbox=!opt_warrior_protection_aoe
+{
+	ProtectionDefaultShortCdActions()
+}
+
+AddIcon specialization=protection help=shortcd checkbox=opt_warrior_protection_aoe
+{
+	ProtectionDefaultShortCdActions()
+}
+
 AddIcon specialization=protection help=main enemies=1
 {
-	if not InCombat() ProtectionPrecombatActions()
-	ProtectionDefaultActions()
+	if not InCombat() ProtectionPrecombatMainActions()
+	ProtectionDefaultMainActions()
+}
+
+AddIcon specialization=protection help=aoe checkbox=opt_warrior_protection_aoe
+{
+	if not InCombat() ProtectionPrecombatMainActions()
+	ProtectionDefaultMainActions()
+}
+
+AddIcon specialization=protection help=cd enemies=1 checkbox=!opt_warrior_protection_aoe
+{
+	if not InCombat() ProtectionPrecombatCdActions()
+	ProtectionDefaultCdActions()
 }

-AddIcon specialization=protection help=aoe
+AddIcon specialization=protection help=cd checkbox=opt_warrior_protection_aoe
 {
-	if not InCombat() ProtectionPrecombatActions()
-	ProtectionDefaultActions()
+	if not InCombat() ProtectionPrecombatCdActions()
+	ProtectionDefaultCdActions()
 }

 ### Required symbols
@@ -199,7 +290,6 @@ AddIcon specialization=protection help=aoe
 # impending_victory_talent
 # last_stand
 # last_stand_buff
-# potion_armor_buff
 # pummel
 # quaking_palm
 # ravager