[Userscript] auto-commit; the end of the enter key

Mempo said...
WillNiels said... If anyone is interested, I made a modified version that doesn't auto commit items that are under a certain % correct. This is so you can't be sure that an item is wrong if it doesn't auto commit.
 Explain yourself
The modified version uses the wanikani api to get a list of critical items. The script checks the list, and if the current item matches one of the critical items, it won't auto commit when you type the right answer. You can configure the percentage correct at which the items are considered critical by changing a variable in the script. I have updated the edited version so that you can cycle through different modes. ( Always Auto Commit, Critical Mode, Random Mode, and Off )

The limitations to this are:
1) If you always get everything right, then the modification has no effect. ( So don't cheat with new items, or everything will auto commit again.)
2) There is probably a performance hit when checking the list.
3) It brings back the need to hit enter sometimes.
4) The way I check the critical list is by character only. So it won't work with some radicals, and if a vocab uses the same symbol as a kanji, neither will be auto committed if one is on the list.

Example:

I get 方 right 90% of the time. If I set the percentage to 90 and I type the right answer in a review, it will auto commit. If I set the percentage to 91, it will be considered a critical item, so when I type the right answer in a review it will require me to press enter.

I'll try to figure out how to post my modification and I will add a link to it here.

Edit: Here's a link to the edited version, https://greasyfork.org/en/scripts/16969-wk-auto-commit-edited/code
Edit2: also @johmik,  if you want me to remove this version or incorporate it into yours just let me know. 
Edit3: I updated the script so you can change which mode you are on. Should be the same link.
Edit4: I made a bug fix. Random mode should work as expected now, hopefully.