<div>The script version would be like this:</div>
var myLayer = app.project.activeItem.layer(1);
var r = myLayer.sourceRectAtTime(0,false);
var myMask = myLayer.property("Masks").addProperty("Mask");
var myPath = myMask.property("Mask Path");
var myShape = myPath.value;
myShape.vertices = [[r.left,r.top],[r.left+r.width,r.top+r.height/5],[r.left,r.top+2*r.height/5],[r.left+r.width,r.top + 3*r.height/5],[r.left,r.top+4*r.height/5],[r.left+r.width,r.top+r.height]];
myShape.inTangents = [];
myShape.outTangents = [];
myShape.closed = false;
myPath.setValue(myShape);
Basically you’re just using the layer’s left, top, width, and height extents as provided by sourceRectAtTime() to calculate where you want the mask vertices to be. I just took a shot at it based on your diagram. Since the mask is all corner points, you can provide empty arrays for the in and out tangents.