Here’s what the code looks for:
in m4a files, the atom is called “cpil”
in id3v2.2, it’s YTCP, and in 2.3+ it’s TCMP.
Anyway, using a id3v2 tagger like “id3v2”, you should be able to do:
id3v2 –TCMP 1
That should do it. You could do that for just a few songs on the album… The compilation tag is on a per-song basis.