Help wanted :) yet again

Shaman macro-need help with

Alright i have revised a shaman macro to work for my level 85 shaman. Wanting him to slow targets pulled, *assists MT*, and also to buff and rebuff when buffs fall off. Right now i have the macro working but for some reason he will cast the Talisman of Unity Rk. II over and over until hes outta mana, Looking for someone to assist me in getting this to stop, only wanting the shaman to cast buffs when they wear off.

Code:
#Event SetTank "#1# tells you, 'settank #2# #3#'"

|################################################
Sub Main
	| Define your MainTank... this is changeable while the macro is running by having new main tank /tell you: secretphrase (see below)
	/declare MainTank string outer krimrol
	/declare SecretPhrase string outer maintank

	| Define your Spells...
	/declare Spell_LANGUOR string outer	"Languor"
	/declare Spell_LYNX string outer	"Talisman of the Lynx"
	/declare Spell_CHAMPION string outer	"Champion"
	/declare Spell_HASTE string outer	"Talisman of Celerity"
	/declare Spell_UNITY string outer	"Talisman of Unity Rk. II"
	/declare Spell_CANNI string outer	"Ancestral Hearkening Rk. II"
	/declare Spell_HOT string outer		"Halcyon Whisper"
	/declare Spell_PATCH string outer	"Dannal's Mending"
	/declare AA_SLOW string outer	        "Turgur's Swarm"
	/declare AA_Malo string outer		"Malosinete"
	/declare ITEM_Epic string outer		"Crafted Talisman of Fates"

	| Define what % mana you feel you should canni.
	/declare MinMana int outer 90

	| Define if you want to HoT (heal over time) or not. Also define what % health you want to HoT the MT.
	/declare DoHOT bool outer FALSE
	/declare DoHOTPercent int outer 85

	| Define if you want to PATCH heal or not. Also define what % health you want to heal the MT.
	/declare DoPATCH bool outer TRUE
	/declare DoPATCHPercent int outer 70

	| Define if you want to auto-slow mobs or not. Also define what % health you want to slow the mob.
	/declare DoSLOW bool outer TRUE
	/declare DoSLOWPercent int outer 97

	| Define if we want to malo mobs or not.
	/declare DoAAMalo bool outer TRUE

	|
	| Don't need to edit below this line!
	|

	| Lets see if a MT was passed as an argument to the macro.
	/if (${Defined[Param0]}) {
		| We have a MT passed, lets use that instead of our default!
		/varset MainTank ${Param0}
	}

	/echo Loaded Short Duration Buffs v1.0 by memset
	/echo MAIN TANK: ${MainTank}
	/echo CANNI AT %: ${MinMana}% Mana
	
	/if (${DoHOT}) {
		/echo HOT AT %: ${DoHOTPercent}%
	}

	/if (${DoPATCH}) {
		/echo PATCH AT %: ${DoPATCHPercent}%
	}

	| Check if MQ2Cast plugin is loaded, if it isn't... load it automatically. Thanks VillageIdiot & Unity!
	/if (!${Plugin[MQ2Cast].Name.Equal[mq2cast]}) /squelch /plugin MQ2Cast nocheck


	|################################################
	| START OF LOOP
	:start
	/doevents

	/call GMCheck

	|################################################
	| Target our MT.
	/target pc ${MainTank}
	/delay 1s

	|################################################
	| Make sure we have a target before continuing.
	/if (!${Target.ID}) {
		/goto :start
	}

	|################################################
	| Next, make sure we aren't invisible... if we ARE, don't cast anything.
	/if (${Me.Invis}) {
		/goto :start
	}

	|################################################
	| Also, if we are MOVING... we don't need to cast anything. Will be pointless.
	/if (${Me.Moving}) {
		/goto :start
	}

	|################################################
	| Finally, see if we're casting or not. This was added LATER... so it's slightly redundant below. Clean up later.
|	/if (${Me.Casting.ID}) /goto :start

	|################################################
	| Lets first make sure we don't need to heal the MT.
	| Do we need to PATCH heal the MT?
	/if (${Target.PctHPs} <= ${DoPATCHPercent} && ${DoPATCH}) {
		| It seems so. Better heal! Is the spell ready? Make sure we're not casting already...
		/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_PATCH}]} && ${Target.Distance} < 100) {
			/echo Healing ${MainTank} with ${Spell_PATCH}!
			/casting ${Spell_PATCH}
			/delay 2.5
		}
	}

	| Do we need to HoT the MT?
	/if (${Target.PctHPs} <= ${DoHOTPercent} && ${DoHOT}) {
		| It seems so. Better heal! Is the spell ready? Make sure we're not casting already...
		/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_HOT}]} && ${Target.Distance} < 100 && !${Target.Buff[${Spell_HOT}].Duration}) {
			/echo Healing ${MainTank} with ${Spell_HOT}!
			/casting ${Spell_HOT}
			/delay 2.5
		}
	}

	| There's a possibility that the shaman running this macro could be in need of a heal from canni... check now!
	/if (${Me.PctHPs} <= 80) {
		/target ${Me.CleanName}
		/delay 1s
		/casting ${Spell_PATCH}
		/delay 2.5
		/target pc ${MainTank}
		/delay 1s
	}

	|################################################
	| Lets see if the mob is malo'd... if not, and we're supposed to, then malo it.
	/if (${DoAAMalo} && ${Me.AltAbilityReady[${AA_Malo}]}) {
		| Yes... see if mob is malo'd already.
		/assist ${MainTank}
		/delay 1s
		/if (${Target.Buff[${AA_Malo}].Duration.Ticks} < 1 && ${Target.Type.Equal[NPC]} && ${Target.Distance} < 100 && ${Target.PctHPs} <= ${DoSLOWPercent}) {
			| Ok... malo the mob!
			/echo Malo'ing ${Target.CleanName} with ${AA_Malo}
			/aa act Malosinete
			/delay 4s
		}
	}

	|################################################
	| Now lets check if we need to slow a mob!
	/if (${DoSLOW}) {
		| Ok, we need to slow....maybe. Assist MT, check if it has been slowed already with our spell. Also verify it's an NPC.
		/assist ${MainTank}
		/delay 1s
		/if (${Target.Type.Equal[NPC]}) {
			| Verified this IS an NPC.
			| Check HP's... and if we've slowed already or not.
			/if (${Target.PctHPs} <= ${DoSLOWPercent} && !${Target.BuffDuration[${Spell_SLOW}]} && !${Me.Casting.ID} && ${Target.Distance} < 100 && ${Me.SpellReady[${Spell_SLOW}]}) {
				| HP's match and the mob isn't slow and I'm not casting... AND it's within range. lets slow this mob.
				/echo Slowing ${Target.CleanName} with ${Spell_SLOW}!
				/casting ${Spell_SLOW}
				/delay 1.5s
				/target pc ${MainTank}
				/delay 1s
			}
		}
		/target pc ${MainTank}
		/delay 1s
	}

	|################################################
	| Check if we need to rebuff LANGUOR:
	/if (${Target.BuffDuration[${Spell_LANGUOR}]} < 15 && ${Target.Distance}<100) {
		| Am I currently casting a spell? And is the spell ready?
		/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_LANGUOR}]}) {
			| Good to go! Cast!
			| /casting uses plugin mq2cast.
			/echo Casting ${Spell_LANGUOR} on ${Target.CleanName}!
			/casting ${Spell_LANGUOR}
			/delay 2s
		}
	}

	|################################################
	| Check if we need to rebuff CHAMPION:
	/if (${Target.BuffDuration[${Spell_CHAMPION}]} < 15 && ${Target.Distance}<100) {
		| Am I currently casting a spell? And is the spell ready?
		/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_CHAMPION}]}) {
			| Good to go! Cast!
			| /casting uses plugin mq2cast.
			/echo Casting ${Spell_CHAMPION} on ${Target.CleanName}!
			/casting ${Spell_CHAMPION}
			/delay 2s
		}
	}

	|################################################
	| Check if we need to rebuff LYNX:
	/if (!${Target.BuffDuration[${Spell_LYNX}]} && ${Target.Distance} < 50) {
		| Am I currently casting a spell? And is the spell ready?
		/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_LYNX}]}) {
			| Before we cast, lets make it so it only casts if MT has a mob targeted and the mob is closeby..
			/assist ${MainTank}
			/delay 1s

			/if (${Target.Distance} < 100 && ${Target.CleanName.NotEqual[${MainTank}]}) {
				| Good to go! Cast!
				/target pc ${MainTank}
				/delay 1s
				/echo Casting ${Spell_LYNX} on ${Target.CleanName}!
				/casting ${Spell_COUGAR}
				/delay 4s
			}
		}
	}

	|################################################
	| Check if we need to CLICK EPIC:
	/if (${FindItem[${ITEM_Epic}].Timer} == 0) {
		| Epic clicky is ready... do we need to click it?
		/assist ${MainTank}
		/delay 8
		/if (${Target.Distance} < 100 && ${Target.Type.Equal[NPC]}) {
			| Yep. Lets click it!
			/casting ${ITEM_Epic}
			/delay 1s
		}
	}

	|################################################
	| Check if we need to rebuff HASTE:
	/if (!${Target.BuffDuration[${Spell_HASTE}]} && ${Target.Distance}<100) {
		| Am I currently casting a spell? And is the spell ready?
		/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_HASTE}]}) {
			| Good to go! Cast!
			| /casting uses plugin mq2cast.
			/echo Casting ${Spell_HASTE} on ${Target.CleanName}!
			/casting ${Spell_HASTE}
			/delay 4s
		}
	}

	|################################################
	| Check if we need to rebuff UNITY:
	/if (${Target.BuffDuration[${Spell_UNITY}]} <= 15 && ${Target.Distance}<100) {
		| Am I currently casting a spell? And is the spell ready?
		/if (!${Me.Casting.ID} && ${Me.SpellReady[${Spell_UNITY}]}) {
			| Good to go! Cast!
			| /casting uses plugin mq2cast.
			/echo Casting ${Spell_UNITY} on ${Target.CleanName}!
			/casting ${Spell_UNITY}
			/delay 2s
		}
	}

	|################################################
	| Check if we need to cannibilize:
	/if (${Me.PctMana} <= ${MinMana} && ${Me.SpellReady[${Spell_CANNI}]}) {
		| Less than or equal to minimum percent of mana... lets canni.
		/echo Casting ${Spell_CANNI}!
		/casting ${Spell_CANNI}
		/delay 1s
	}


	/delay 1s
	/goto :start
/return


|################################################
Sub Event_SetTank(line, sender, new_tank, secretphrase)
	/if (${secretphrase.Equal[${SecretPhrase}]}) {
		/echo ${sender} sent secret phrase, setting ${new_tank} as tank!
		/varset MainTank ${new_tank}
		/target pc ${MainTank}
		/delay 1s
	}
/return

|################################################
Sub GMCheck 
   /if (${Spawn[gm].ID}) { 
      /beep 
      /beep 
      /beep 
      /echo GM has entered the zone! 
      /echo FUCK HIM but ending the macro... 
      /keypress forward 
      /keypress back 
      /quit 
      /endmacro 
   } 
/return
 
Is it targetted to your main tank when you're in the Unity Loop?
 
So...don't post in multiple places. You're already working on this problem in another post, stick with it. :)

Thanks,

BC
 
Yea everything goes through my main tank *which would be krimrol* Its just for some reason he re casts Unity until he is out of mana and not sure why.
 
imo just use downshits to keep buffs up, works great w/ my afk exp so it doens't have to be part of the macro.
 
problem is with that spell your casting Unity of spirts and there is no matching buff so it keeps casting. don't think there is a fix for it, i just send a tell to my shaman and have him cast it not try and keep it up on me
 
Ok so i should just take out the unity buff part? How do i set it up to where i am able to send a tell for the buff? if all else fails i guess i can just do it myself and leave that out since its a pretty good timer
 
there are 3 or 4 shaman macros out there no need to reinvent the wheel