Can you please provide some more info about your tank? Exact numbers for ammonia, nitrite, nitrate & ph?What your using to test (liquid or strips)? Water change schedule (%/#wk)? Number of fancies? Number of comets? Other fish? Filtration? Diet?
Goldies gulping at the surface can be any number of causes but number ONE is water quality & overstocking. Zero ammonia, zero nitrite and under 20ppm nitrate though for more sensitive fancies, under 10ppm nitrate are the only accepatble parameters. In your case in particular, your tank is heavily overstocked. A 36g is really only suitable for 2-3 fancies and this is only while they are juveniles. Comets are pond fish that realisitcally do not belong in home aquaria because they have huge water requirements and can grow quite large (over 12in) with proper care.
The second primary cause of gulping at the surface is a simple one- lack of oxygen. Keeping the tank cooler (70-74f) and having lots of aeration will address this.
The third cause is disease, namely parasite issues. Flukes are a rampant issue in goldfish and almost all goldies at a lfs are at a risk of being infected with them. Ich in the gills will cause similar symptoms as well.
A fourth cause is behavioral though this is controversial. When stocking, water quality, oxygen and disease issues have ALL been addressed, goldies will learn this behavior from other goldies. But, in most cases, its a single sick fish with this behavior and this sick fish will infest the other fish so its actually not behavioral, but a disease issue. However, after resolving the issue, some fish will still persist with this behavior because its something of a learned adaptive response to being deprived of oxygen via water quality, aeration or disease.
Swim bladder is another topic in itself and is a 'catch all' name that can be attributed to numerous to different causes and diseases. In fancies, sb is not a disease itself but a buoyancy issue. It can be attributed to diet,bacterial infection, parasites, viruses, other disease, water quality, water temp, water depth, genetic abnormalities, regulation defects, injury and a plethra of other reasons. Trying to determine an exact cause is extremely difficult but preventing the most obvious causes (water quality & temp, diet, parasites, injury) are simple ways to try and avoid buoyancy issues in fish that are prone to these problems. Heres some more info on goldies and their care- please ask if you have any questions!
http://www.myaquariumclub.com/goldfish-101-11174823.html