bonding energy calculation

I am performing MD NPT->NVT simulation using Forcite with pcff FF of three component system namely: Alginic Acid chains (AAC), water (W), and Ca2+ ions (I). I want to caculate interaction (bonding energy) between Ca2+ ions and AlginicAcid Chains using following relation

 

E_bonding = E(AAC+W+I) - E(AAC+W) - E(I+W) - E(I) - E(W) - E(AAC)

 

I want to calculate E_bonding as a average ofer specifi time frame. I can do this via scripting by taking trajectory file and using sets calculate frame by frame SPE of specific components. This however would be very inefficient. Can you propose solution to this on the fly during Forcite job?