Carrier-capture-assisted optoelectronics based on van der Waals materials to imitate medicine-acting metaplasticity