How much is an autopsy usually?
Sorry to hear you lost your chameleon.
Necropsy costs about $100 without sending anything to pathology. Pathology will add another $200/$250. I take a look inside myself and if I don't have a pretty good idea why, I often take everything over to the vet and possibly having specimens sent to pathology. The animal needs to have been refrigerated (NOT frozen) soon after death. I have a large collection, so knowing why I lost an animal is very important for me.
I think everyone should open up their dead chameleons and start to learn about the inner workings. I take good photos that I will share with my vet or others. How the animal presents to you often has nothing to do with what is really wrong. Look at some of the suggestions you have been given, everything from parasites to MBD and intestinal blockage. I can add a few others that it could be and you would be as in the dark as you were before you posted.
The extreme small size is concerning and that really should have been investigated and dealt with long before he declined so badly.
Regardless of what many on this forum say, it's really really hard for reptile vets to diagnose ill chameleons. They tend to rule things out and then take a best guess. I've had animals that were not thriving, in fact were trying very hard to die on me that the experienced vets hadn't a clue what was wrong that I ended up saving by force feeding for four months before they decided to live. Few people would be able to keep up that kind of a regime for an animal that was failing.
Also, few people are prepared to spend a lot of money trying to try to save a chameleon that is not doing well.
Clean the cage very well and throw out anything like plants and vines/perches. I use full strength bleach as well as baking the cage in the sun.
Again, sorry for your loss.