Here’s an example for opacity. You’ll need to adjust the parameters to fit your situation:
minDist = 600;
maxDist = 800;
minOpacity = 30;
maxOpacity = 100;
d = length(toWorld(anchorPoint),thisComp.activeCamera.position);
linear(d,minDist,maxDist,maxOpacity,minOpacity)
Dan