Why JS? I wanted to help you with a simple advanced action, but I don't know how you did set up the JS instead of using the default design of the score slide. That means that I have no idea if the system variable cpQuizInfoAttempts is incremented as normally is the case when using the Retake button on the score slide.
I do not need to use JS if it is possible using advanced actions I am happy to do it that way. I was not sure if the advanced action was capable of what i need to achieve.
The Retake button will only appear if the learner fails, I don't think you want the 'extra' button for retaking the complete course to appear in that case?
I have written multiple blogs about tweaking quiz and score slide, but not this specific use case. Have an idea how to do it by a modification of one of my blogs, but maybe you prefer JS anyway. If a JS expert pops in, will step away. Here is the blog I refer to:
For the skipping, have posted that several times in this and other forums, but will need also a slight modification.
You will need one user variable, a custom shape button and a custom message on the Score slide, one advanced action On Enter for the score slide, and a shared action to be used On Enter for each first quiz slides after the modules. They are not really complicated.