What is the terminology used for a (few)-bit permanent memory latch?
I would also suggest you look at a digital volume control chip (DS1669). Perhaps not common these days but popular a while back.  You could ramp the attenuation up and down with an up and down digital input and it would write it to internal EEPROM when idle.  It would survive power off and could be even used to store a few bits if you were to read the attenuation setting with an analogue input.

Most micros have versions with FLASH on chip so it would only require one IC.  

A supercap, capacitor or button cell will keep the state of a 4000 series CMOS register stable for a LONG time.

There is a tiny FPGA IC (Lattice iCE40UL1K-SWG16) that might do the job as seen on https://hackaday.io/project/6592-dipsy but I am not sure if it can self modify.