Use this double counter to keep track of Turns and Chains when doing SOS Battles in Pokemon Sun/Moon. Increment the Turns counter every turn to keep track of how much PP the base creature has used up. Reset the Turns counter whenever the base creature faints and you switch to a new base creature.
Increment the Chain counter whenever you faint a creature. Once the counter reaches 70 or higher, you have the best chance for finding high IVs, hidden abilities, or shiny creatures. For more information, go here.
Some of the code and styling was stolen from Codecademy. Thanks, Codecademy!