The 27-year-old has been linked with a move away from the club this summer, notably to Premier League rivals Arsenal and Chelsea, after handing in a transfer request towards the end of last season.
However, Cole feels that the chance to make history at the Red Devils could make him stay at United, with Rooney just 52 goals away from equalling Sir Bobby Charlton's record of 249.
"To have the opportunity to be the top goalscorer in the football club's history? I'd stay around for that, for sure," Cole told reporters.
"But it's not for me to advise him. Wayne's his own man, that's what has made him the player he is. He knows what he wants to do. David Moyes has said Wayne's not going anywhere and, hopefully, that will be the end of it."
Cole scored 121 goals in under seven years for United.