The error message suggests that ccObject.ShowWaitCursor(true); is being called with an incorrect number of arguments, or the method doesn't exist in CodeCharge Studio 5.1.
Check if ccObject.ShowWaitCursor() Exists in CCS 5.1
Open the developer console (F12 in a browser) and check if ccObject is defined.
Type ccObject.ShowWaitCursor in the console and see if it returns a function or undefined.
Also, Some APIs change between versions. Try calling ccObject.ShowWaitCursor(); without the argument:
Ensure that all required JavaScript files are included in CCS 5.1. Look for any JavaScript errors in the console that might indicate missing files.