Help statusmenu ans yep

Hello. I come to you for two problems. Like many people, I try to make a pokemon game for fun. I blocked the menu of two menus.
I explain: I want to display 6 pokemon in the status menu. then i change the command windows_menustatus.prototype.maxitemd = function () return 6 it only works if i have six pokémons but the bug i have less.
the second problem comes from the plugin yep_x_actorpartyswitch which allows, as its name suggests, to change characters in combat. it also shows all the Pokémon and I wanted to show the first 5 characters who are not in combat.
I change my line var length = 6 to try but as far as the status menu is concerned, it only works if we have at least 6 characters otherwise it is blocked. I tried with a variable but as I do not know, it does not work.
if anyone has an idea, it will help me a lot. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/help-statusmenu-ans-yep.104388/