Hi Davod,
From what I can find, there is no way in settings to have your phone act differently when on power as you have described.
You can extend your screen on time by choosing how many minutes in Settings>Display & Brightness>Auto-Lock.
You may be able to download a 3rd party app, but I do not know of any off the top of my head.