Try it like so:
var uvAttribute = geometry.attributes.uv;
for ( var i = 0; i < uvAttribute.count; i ++ ) {
var u = uvAttribute.getX( i );
var v = uvAttribute.getY( i );
// do something with uv
// write values back to attribute
uvAttribute.setXY( i, u, v );
}
For debugging a small live demo: Edit fiddle - JSFiddle - Code Playground