Script to calculate AP in Chain Chronicle