Depends. The condition you have is called cough syncope. As long as you supress the cough your fine. If you do pass out it's related to the vagus nerve and usually resolves quickly without permanent nuerologic sequella. However if your driving or up on a ladder and you do have an attack , the consequences could be disastrous. Pts like this need aggressive cough suppression with colds or infections.
Complete check up. Probably this will not affect your long term health and life span. You should have a heart monitor to see if you have a long pause in heart beat making you faint. Take measures to sit or lie down when you have a coughing spell. Pacemaker can sometimes help if it becomes a nuisance and a long pause in heart beat is documented. Have a complete check up by a cardiologist.