Myopathies in systemic disease results from several different disease processes including endocrine, inflammatory, paraneoplastic, infectious, drug- and toxin-induced, critical illness myopathy, metabolic, collagen related,  and myopathies with other systemic disorders. Patients with systemic myopathies often present acutely or sub acutely. On the other hand, familial myopathies or dystrophies generally present in a chronic fashion with exceptions of metabolic myopathies where symptoms on occasion can be precipitated acutely. Most of the inflammatory myopathies can have a chance association with malignant lesions; the incidence appears to be specifically increased only in patients with dermatomyositis. 
So CD4 counts appear to be a useful tool in assessing risk, but other factors also contribute such as lung architecture. In a retrospective study of 74 patients with interstitial lung disease on corticosteroids, 7 patients developed PCP. The mean dose at time of diagnosis was prednisone 37mg with mean duration of 10 weeks. CD4 counts ranged from 59 to 836, with a mean of 370 . The authors argued that due to their underlying lung disease, the patients were at higher risk for PCP and became infected at higher CD4 counts than patients with other underlying diseases.