This is what I use I'm sure there is a cleaner way to do it but just put this in your combat sub or something so you know it will go off if you are attacking. If you are a melee it make take a dozen attempts but at least you know it will go off during battle.
/if ((${Target.Distance}<15) && (${Me.AltAbilityReady["Lesson of the Devoted"]})) {
/aa act Lesson of the Devoted
P.S. I hate when people flame and don't just give up the info. If you don't know just say you don't know or don't reply. Let person with the question mess around with it and decide for them selves if its working out.