Using Google Earth Engine to exclude upper 1% of data?

It's going to be something like this:

var geometry = ee.Geometry.Point([-121.17167968749999, 38.190443614671594]);
var s1_data = ee.ImageCollection('COPERNICUS/S1_GRD')

var s1_grd_iw_vv_des = s1_data
  .filterBounds(geometry)
  .filter(ee.Filter.eq('instrumentMode','IW'))
  .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
  .filter(ee.Filter.eq("orbitProperties_pass", "DESCENDING"))
  .sort('system:time_start')
  .select('VV');

print(s1_grd_iw_vv_des)

var withPercentiles = s1_grd_iw_vv_des.map(function(image) {
  return image.set(image.reduceRegion({
    reducer: ee.Reducer.percentile([99]), 
    geometry: image.geometry().bounds(), 
    scale: image.projection().nominalScale(), 
    bestEffort: true
  }));
});
print(withPercentiles.first())

var masked = withPercentiles.map(function(image) {
  var mask = image.lt(ee.Image.constant(image.get('VV')));
  return image.updateMask(mask);
})

var check = ee.Image(masked.first());
Map.centerObject(check, 8)
Map.addLayer(check, {min: -25, max: 0}, 'check')