plus side is I learn people can still read an encrypted file, but how?
You should not make such rash assumptions...
What makes you believe I fall in the group "people"?
As far as my dictionary goes, "people" only contains human beings.
EDIT:
This will do for now.
I will try to make the code a bit more pretty but in the meantime, you should just use this for now.
It requires a unit indexer.
You have 3 global variables.
1, The event.
2, The unit that has its mana changed.
3, The amount of mana that has been changed.
To use the event, just create a trigger and make the event "Game - ManaDetection_Event becomes equal to <x>"
If <x> is 1, it will run when a unit has gained mana.
If <x> is -1, it will run when a unit has lost mana.
(Be aware that this will run for all units that you added to it so you want to have a check if the unit has your item before you want to store the value and stuff.)
To add the event to a unit, you use "Custom script: call AddManaDetectionEvent(<unit>)"
And to remove the event from a unit, you use "Custom script: call RemoveManaDetectionEvent(<unit>)"
Where <unit> is the unit that has to be checked.
You have to do this when your unit picks up an item, enters the map, dies, revives, loses an item, etc.
For your spell, (Acquires an item :: Add) (Loses an item OR Unit dies :: Remove)
There is one problem that you have to check if the unit has other items of that type before you remove him from the events.
Because if he has 2 items and loses 1, he should still have the event.
The values are not completely accurate, but I have to search through my systems to find the exact minimum change value for the trigger.
Then I can round it to the nearest integer to find the (probably) exact value.
But in any case, just try out the map!