The idiom "to cast a shadow over/on something or someone" means to fill something with grief, dread or any strong emotion. I am going to make up an example with it.
(ex) John used to like math a lot when he was young. However, his repeated failures in the subject made him lose total confidence and have cast a shadow on him ever since.
Am I using the idiom correctly? Thanks a lot.