Editor: script to update geometry width/height segments

I am using the editor to create a plane with the displacement map applied to; i set 200 segments in the width and height.

I would like to add an script to create a level of detail, when LOD near is these 200 segments and when far distance from the camera the segments reduces to 1.

How is done this script in three.js?

You have two examples here to start.
But going further than these require exponential amount of work.
I hope you’re motivated

Simple camera-based LOD for procedural mesh
https://threejs.org/examples/?q=lod#webgl_lod

Complex mesh batching
https://threejs.org/examples/?q=lod#webgl_batch_lod_bvh

Do you want to increase LOD for the plane? Or for objects?
I use textures a lot to increase apparent resolution.
There is also a technique where you can use different LODs for a single plane, by subdividing nearby grids. You can find a good discussion of this here on the SimonDev website..