Will it hurt my baby?

I REALLY want to breastfeed but I’m a smoker. I know you shouldn’t smoke while pregnant but my dr suggested me to slow down not to quit because I was already a high risk pregnancy and quitting would add stress which would be bad for Baby so I have cut down ALOT! Going to try and quit the day he is born while still in the hospital but if I don’t can I still breastfeed? Or will it hurt the Baby?!?!