I've experienced the negative stats during training bug. It seems to relate to armor being worn. For Example, If the MC was wearing the plate armor with -30 agility and then trained with the arena girl; the MC would lose between 20 to 30 agility. Conversely, If the MC had the +10 constitution bracers on and trained with her and the training resulted in a constitution gain, then the +10 from the bracers was added to gain. It was the same with training charisma with the leprauchan girl if wearing the +charimsa coat. I don't know if this will help you figure it out in the code, but it's just what I observed.