I have very little experience with the spell casting ai..although...
You could 'try' remarking out this line:
https://github.com/EQEmu/Server/blob...lsai.cpp#L1007
and its scope closer here:
https://github.com/EQEmu/Server/blob...lsai.cpp#L1019
to see if that works.
That would keep you out of the database modifications.