http://pastebin.com/aJJqCHw9
Some of those copied action button functions were... really inefficient, creating new tables on every action button update, performing the same function call or global lookup 5 times in a row instead of storing the result in a variable, etc.