This question is an addition to this answer to Creating Sentinel-2 cloud free, cloud-shadow free composite or scene on Google Earth Engine (GEE)?
There Rodrigo E. Principe showed how to mask out the clouds. I am wondering if there is a way to mask the shadows as well. And, if possible then not only the shadows of the clouds but also, shadows in rugged topography.