Do you know the popular game World Of Warcraft (WOW) made by Blizzard? Tom plays a Blood Elf Paladin in WOW. The Paladins have 3 kinds of talent trees: Holy, Protection and Retribution.
The Holy Paladins in a team are healers, who provide healing service, heal the wounded; the Protection Paladins in a team are tanks, who attract the enemy's fire and protect the teammates; the Retribution Paladins in a team are melee damage dealers.
After the version Cataclysm is published, the Retribution Paladins are found weakened by Blizzard. But fortunately, the Holy Paladins become more and more powerful amount the healers.
In order to join the dungeons and raids easier, Tom choose the talent of Holy to be his role's main talent (because the dungeons and raids are lack of healers). What a nice job the Holy Paladin is! Instead of standing in front of the monsters and enduring the hit, the only thing the Holy Paladins should do is to heal teammates and hardly worry about the monsters would attack them.
Unlike the Retribution Paladins' operation of "Keyboard Rolling", the Holy Paladins have many spells to use of healing, so that some part of the pressing of some spells would be overlapping with each other. Furthermore, once a spell was cast successfully, it would possibly lead to casting one spell easily, that means you can get a buff which would allow you cast one spell in another way (The spell the buff effects can be anyone he can cast).
It is high-operation-frequency when in the dungeons, so Tom can hardly notice whether he cast a spell successfully or how much he had healed. And Tom really wants to know that, so he turns to you for a favor, asks you to write an Add-On which can help him record the total healing points and which spell brings higher total healing points.
About the spells:
Each spell has a distinct name.
Spell needs Mana Points(MP). You cannot cast the spell when there is not enough mana.
Spell has Cool Down Time. Once you cast a spell successfully, you cannot cast the same spell during the next Cool Down Time.
If you fail to cast a spell, the keys you have pressed can be the prefix of the next spell.
If spell-2 is the suffix of spell-1, then spell-1 is priority.
No two spells can be cast in same moment.
Some spells will lead to some buffs(described above) so that when you press some other keys sequences, you will cast some spells, too. Notice that the buff will exist until you cast the exact spell successfully, no matter you use the buff or not. (In other word, if you get the buff of spell A, then you don't use the buff but cast the spell A, the buff of spell A will disappear.)
One spell will immediately be cast once it fits the spell condition.
Besides, the Holy Paladins have a talent called Meditation, which will regenerates one mana every second. Meditation will regenerate MP immediately when one second starts. And Tom can press 5 keys every second.