Dynamic Scale Rig

Hey guys I wanna Rig these shapes so that i can control the scale of each rectangle seperately (I also want to be able to scale x and y seperately of each rectangle) and that if I change the scale of one the others adapt to the change of size. It would be enough If Just the rectangles Next to the one being scaled would be affected. I got a decent result with this Expression ( I will ad an screenshot )combined with a slider control on a Null But I only was able to get them to interact with each other in one scale direction. I think what would also be better to what I did If I could use the Scale Propertie Instead of the Size Propertie so I can Replace the rectangle with other stuff if needed . Can anyone Help me ?

https://preview.redd.it/wjs4w6l3l8hb1.png?width=1968&format=png&auto=webp&s=74925df0033ac085f7aa552014fddcdd9c365bf9

Expression in Size Propertie (I got two Sliders )

n = 500 - thisComp.layer("Null 7").effect("n")("Slider");

s = thisComp.layer("Null 7").effect("s")("Slider");

[s,n]

Expression in Anchor Point Propertie

A=sourceRectAtTime();

[A.left+A.width,A.top+A.height/2]