Animated feature with skeleton 1980's
I watched a movie some time ago when I was a kid and I cannot remember much about the movie or what the title is. It was most likely a 1980's kid's movie. What I do remember is that at some point there is a skeleton who talks to the good guy(don't remember who that is) and I think they are outside by a cave at night, and the skeleton is not necessarily evil, but maybe asks the good guy a riddle in order to get past him or get jewels. It seemed to be quite scary as a kid. That's all I remember about it, and it's driving me crazy. Sorry, but any help or suggestions would be greatly appreciated! Thanks!