How do you comp behind a soloist when the lead sheet requires them to solo not on the original form of the song and the possibility of singing the melody is not there any more?is counting the only solution?
You don't have to always play off the melody. You can play the 4 or 8 bar phrases generically, or play things that just enhance the groove, or just listen to the soloist, or play what seems right for any other reason. Look for the larger phrases and play off those. You can also look for changes in harmonic rhythm. The last thing I would be doing is counting-- only if the solo form is very weird/stupid, and I haven't figured it out yet. Sometimes if a composer/arranger has written an unfriendly form for blowing, I'll ignore the chart and just play. You figure it out after awhile.
If you have an odd/non-standard/irregular solo form, just try to determine the phrase lengths within it, and help outline those phrases with your comping.
What tune are you dealing with, here? I take it it's somebody's original tune, with an involved arrangement, so the soloing is not over the regular tune form?
If you're just playing a standard tune with alternate blowing changes, you should still be able to sing the tune over the blowing changes.