You could set up an expression for your mask path, where the height is based on the slider value. This example is more complicated than it needs to be, because I wasn’t sure whether your path goes clockwise or counter-clockwise so the expression allows for either:
s = effect("Slider Control")("Slider");
p = thisProperty.points();
if (p[1][0] < p[3][0]){
p0 = p[3] - [0,s];
p1 = p[2] - [0,s];
newP = [p0,p1,p[2],p[3]];
}else{
p0 = p[1] - [0,s];
p3 = p[2] - [0,s];
newP = [p0,p[1],p[2],p3];
}
createPath(newP,[],[],true)