I wonder if the history stats, which can track specific states, could be persuaded to do what you want.