I was just about to upload my mod mod, then I noticed a big problem with the code I'd proposed here earlier. Actually, I have no idea where the problem is, but it seems to be linked to the caster.setHasPromotion(gc.getInfoTypeForString('PROMOTION_HASTED1'), False) line. Whenever the promotion should be removed, it instead causes the unit to gain large negative strength of every type.
I also noticed a similar problem in a portion of code I added to the CvEventManager.py file which isn't working. I don't remember whether it was 1. where I was trying to cause living units that die on a certain terrain improvement ("Accursed Ground", a new improvement created by my new Death III Sorcery spell) to rise again as barbarian Skeletons with the strength and most of the promotions of dead unit. (I used the same .setHasPromotion... line to make sure the Skeletons didn't get courage, valor, channeling 1-3, sorcery, summoning, divine, blessed, etc., from their earlier promotions.) Or 2. Where I tried to make goblins once again turn to wolf riders when they kill a wolfs.
I got this error from the PyPerTurn effect I added to the vampire promotion (I set it up so that, when not in their own territory, vampires randomly get a very negative promotion, Famished, which reduces their strength, make them less effective casters, makes them more vulnerable to magic, gives them negative healing, and a small chance of turning barbarian. If the vampire is on on the same tile as a bloodpet, the bloodpet gets injured instead of letting its vampire master become famished. Famished is removed by feed or feast, which can also grant a temporary "Satiated" promotion, whose effect is the opposite of Famished). I was thinking it could be caused by using the "Break" command (effectValidHaste and effectVampirism are the only 2 places I've ever used "break"), but now I'm thinking it is because I called a variable that I'd only defined within an if statement; if there wasn't a bloodpet on the same tile as the vampire, then the code called a variable that didn't exist.
I also remember that whenever I've run into negative strength before, the game works fine until the unit engages in combat. When a negative strength unit tries to fight, the game freezes and not even Ctrl-Alt-Del can stop it; it requires restarting the computer. (Negative movement makes game freezes up like that if you accidentally try to move the unit. Edit: the Skeleton's movement went negative the next turn)
I'll try to see if I can remedy the situation, but I thought I'd try to explain the delay first, and to see if anyone knows an easy solution to the problem.