I dunno anything about the source for the battle video parser, but I do know that the stats are properly enumerated in the order HP, ATK, DEF, SPD, SPATK, SPDEF. Zero-based index (the proper way) would have Attack be 1, but otherwise 2 would work as well.
Are the stats inconsistently denoted throughout the source code? Can't one simply declare const static int or enum for stats?