9 speed rear shifters should only click 8 times. If the chain and cassette are really worn, replace both before you go wasting much more time with the shifting problem. Might as well replace your derailler cable and housing while you're at it. Then follow the procedure at
www.parktool.com for setting the limit screws and adjusting the cable tension. Your friend likely made things worse by playing with the limit screws without really knowing what he was doing (because if he did know what he was doing, those would be the last things he touched).