By default, in Shopify you can do so from discounts settings.
Can set the percentage discount and for specific collections and also you can set the Minimum products for which the discount should be applicable.
Also, you can check this link which will help you in achieving your requirement :- https://help.shopify.com/en/manual/discounts
If you want any further assistance you can DM me. i can assist you in achieving it.
Nick here from Shopify.
As @Pallavi mentioned, this is possible to do directly in the shipping settings of the Shopify admin.
Store Admin > Discounts > Create new discount and then you can apply the settings to the mock-up I made in a test store seen in the screenshot below:
Any other questions, let me know!
All the best, Nick