Replace "API TOKEN HERE" with your API token at the top of the script. The token must have permission to create and update study materials (i.e. notes). When the script first runs, you may have to allow requests from www.wanikani.com to api.wanikani.com. (This is due to a workaround I employed because I was unable to create or update notes using standard functions.)
This script tracks incorrect responses and displays them and their counts in item info. The data is stored in an item's notes. This is so that the responses and counts are persistent across all clients with the added benefit that you can view them later without this script running. I still haven't figured out how to make the script work for radicals. The data is stored in JSON format for ease of parsing and rendering page elements. If a note already exists, the data will be appended to the note. In the future I'm considering adding diagnoses for the incorrect responses, such as rendaku, glottal stop, visually similar kanji, etc.
Use at your own risk! While the intention of the script is to leave existing notes intact, this script may have bugs which overwrite your existing notes.