I found this when doing some further testing after a familiar setup that should have resulted in 0 spell charges being used at all times was still resulting in spell charges being used.
My initial combo was the Clamorous Cockatrice( +2 to race stuff) fused with Clawing Cockatrice (last 3 same race as first) in last spot, the signet material from nether boss kills that gives +2 to race stuff, and the +3 to race traits from tribalist anoint. I then put the familiar that grants 10% chance/familiar to not consume spell charges in the first slot, the familiar with spell pen in the second slot, and then had tanukrook in 3rd, fire salamander in 4th, and then some random ones that had no effect on this process in 5. This should have actually resulted in no spell charges being used, as there are 3+3+2+2+2 = 12 familiars on paper. Unfortunately, lo and behold, I found my spell gem still hit 0 after the very first set of turns.
I then grabbed the familiar that grants 25% increased stat boosts from spells per familiar and did some testing in low level realms with a high level familiar and cockatrice, but low level garbage filling the rest of the slots, with blur. I found that when the back 3 of my party died, the amount of speed granted by blur to all monsters on my team immediately reduced on second cast, but if they lived, the amount stayed the same on second cast.
Then, realizing it may be that dead creatures simply aren’t counting at all, rather than something to do with the cockatrice, I made a party of a bunch of familiars. one with the 25% perk at high level, a couple low levels, and another high level to manually kill them and see if the number changes. It did, killing two off resulted in exactly a 50% decrease in the amount of stats granted
It calculated as:
base speed granted * 25%*(number of total familiars-number of dead familiars)