How is cognitive ability linked to the presence of sex chromosomes?
If you are thinking that, say, a chromosome 1 triploidy will not result in cognitive impairment... that's not quite right.  Almost all triploidies result in death.   Same with chr2, chr3, chr4...just about every chromosome is lethal if there are extras.
It's not so much that having extra sex chromosomes is bad for cognitive function, it's that having extra chromosomes is usually lethal, only a few triploidies are even survivable, and they all cause lots and lots of problems, including cognitive impairment.  Having extra sex chromosomes is the mildest one, and it results in lots of comparatively mild problems.