Limiting output current of a Buck Converter
You need to sense the current, one way of doing it is below circuit:







simulate this circuit &ndash; Schematic created using CircuitLab

Above circuit is a simple low-side current sensing overcurrent protection. LM358 is wired as a comparator, it can't measure very accurately because it's not a rail to rail op amp but for this purpose it's good enough.

V1 is our voltage reference, using ohm's law at 10A voltage drop on R1 is going to be 1V. once it's gets above that opamp will draw it's output to the positive rail activating transistor base and drawing mosfet gate low. it will oscillate and keep the output current at 10A.

You can adjust the current to a lower value by lowering the V1 voltage.

The circuit is just an example on how it's done, of course you can measure the current at high side of the circuit etc. but it gives you an idea.