Thanks for your question on Health Care Magic.
I can understand your situation and problem.
Chest pain on coughing is classical sign of pleurisy (inflammation of pleura).
And common causes for pleurisy are pneumonia,
pleural effusion,
tuberculosis etc.
You are also having chronic bad cough. So better to first rule out all these conditions.
So get done chest x ray first.
If this is normal than no need to worry for all these causes.
You are mostly having
musculoskeletal pain.
So avoid strenuous exercise and heavyweight lifting.
Avoid bad postures in sleep. Avoid movements causing pain.
Start painkiller and
muscle relaxant drugs. Apply warm water pad on affected areas.
Don't worry, you will be alright.
Hope I have solved your query.
Wish you good health. Thanks.